Hi Bram,

The service should be removed from the service registry when you remove the
Component from DependencyManager.

Now, I tried to reproduce the issue you are describing in [1], but I could
not (the test is OK).
Can you please take a look at it in order to see if it the same kind of
scenario you have ? Am i missing something ?

thank you;

cheers;
/Pierre

[1]
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/api/AddRemoteTest.java

On Wed, May 25, 2016 at 8:38 PM, Bram Pouwelse <[email protected]> wrote:

> Hi,
>
> I have an issue with a bundle that removes a DM component before the bundle
> is started. If that happens the service remains available in the service
> registry.
>
> I could reproduce this using a simple activator (which doesn't make any
> sense but works to demonstrate the issue).
>
> public class Activator extends DependencyActivatorBase {
>
>   @Override
>   public void init(BundleContext arg0, DependencyManager dm) throws
> Exception {
>     Component addRemove =
> createComponent().setInterface(Object.class.getName(),
> null).setImplementation(Object.class);
>     dm.add(addRemove);
>     dm.remove(addRemove);
>   }
> }
>
> After starting this bundle the dm gogo command doesn't list any components
> but the service is available in the service registry.
>
> g! dm
>
> g! inspect cap service 1
> dm.test [1] provides:
> ---------------------
> service; java.lang.Object with properties:
>    service.bundleid = 1
>    service.id = 4
>    service.scope = singleton
>
> g!
>
>
> Is this expected behavior or a bug?
>
> Regards,
>
> Bram
>

Reply via email to