Hello Marian,

On 22 Apr 2011, at 13:33 , marian grigoras wrote:

> i want to use the DependencyManager to register a component which does not
> offer any services for other components, but only listens to events and
> displays them. With the registration code shown below, the events arrive at
> the component, but the start(), stop() methods are never called.

Could you please show me the implementation of the component so I can take a 
look at the signature of the methods you use?

> According to the spec, the component should have immediate=true to be
> activated even if not needed by someone else.

That sounds like a part of the declarative services specification, not the 
dependency manager API. The dependency manager does not implement an OSGi 
specification.

> How can I achieve this using the DependencyManager?
> 
> Component component = mDependencyManager.createComponent()
>            .setInterface(EventHandler.class.getName(), eventProps)
>            .setImplementation(MyMonitorConsumer.class)
>            
> .add(mDependencyManager.createConfigurationDependency().setPid(pid));

This looks good, your component should be activated as soon as the required 
configuration dependency is present. In other words, it looks like you're using 
the API as intended, so I suspect there's something wrong with the actual 
callback methods.

Greetings, Marcel


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to