You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Martin Lichtin <li...@yahoo.com.INVALID> on 2020/07/15 19:12:43 UTC
Felix DM - Migrating from version 3 to 4
When migrating from DM version 3 to 4, I've code that's using the stop() method on the Component interface.
component.stop();
What would I migrate this to?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: Felix DM - Migrating from version 3 to 4
Posted by Pierre De Rop <pi...@gmail.com>.
Hello Martin,
you can stop your component by removing it from the dependency manager
object.
Here is an example:
public class Activator extends DependencyActivatorBase {
@Override
public void init(BundleContext ctx, DependencyManager dm) throws
Exception {
Component c = createComponent().setImplementation(Example.class);
dm.add(c);
dm.remove(c); // will stop the component
}
}
regards
Pierre
On Wed, Jul 15, 2020 at 9:13 PM Martin Lichtin <li...@yahoo.com.invalid>
wrote:
> When migrating from DM version 3 to 4, I've code that's using the stop()
> method on the Component interface.
>
> component.stop();
>
> What would I migrate this to?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>