In iPOJO, is there any way to read service properties (e.g. getProperty(key) ) in service consumer? The publisher is pretty straight forward but, in consumer seems I can only use filter.
Thanks
You have to use callbacks to retrieve service properties:
@Bind
public void bindService(HelloService hello, Dictionary<String, Object> properties) {
// ...
}
or
@Bind
public void bindService(HelloService hello, Map<String, Object> properties) {
// ...
}
You can even retrieve the OSGi service registration:
@Bind
public void bindService(HelloService hello, ServiceReference<HelloService> reference) {
// ...
}