There is a possibility that org.osgi.service.event packages is exported twice (or that your bundle has a private copy of that package).
If your bundle registers (or has DS register) the service using one copy of the package and the Event Admin bundle is using another copy of the package, then the Event Admin bundle cannot use your service since it is not compatible. Does your bundle import the org.osgi.service.event package from the same place as the Event Admin bundle? If your bundle only exports the package or simply has a private copy of the package, then the Event Admin bundle will never see your service since the framework will detect that both bundles are not sharing the same org.osgi.service.event package. -- BJ Hargrave Senior Technical Staff Member, IBM OSGi Fellow and CTO of the OSGi Alliance [email protected] office: +1 386 848 1781 mobile: +1 386 848 3788 From: Andrea Zoppello <[email protected]> To: OSGi Developer Mail List <[email protected]> Date: 2009/05/19 08:11 Subject: Re: [osgi-dev] EventHandler are not tracked by event admin service when created by DS Component Factory???? Sent by: [email protected] Hi Miguel, Sorry, i've made a typo error when copyng the xml file on this message. The file is ok, and i just debug the code that DS code ( equinox ) that create the component and register the services, and it seems there's no error in ds implmentation. By the way the EventHandlerTracker is not tracking the services just registered in the registry by ds. I think i'll go in detailed debug of the EventHandlerTracker looking why it's not working. Andrea Miguel García Longarón ha scritto: > Hi Andrea, > > your ds xml file isn't correct, it doesn't contains the <service> tag. > > Regards, > Miguel > > > Andrea Zoppello wrote: >> Hi all, >> >> >> I'm trying to develop a ds component factory that istantiate my >> components on demand. >> >> In particular i've another service that use the component factory to >> instantiate components. >> >> My components implement the EventHandler interface, and i want to >> specify the topic to subscribe >> in the properties just before calling the newInstance method on the >> factory. >> >> The problem is that even if my component implements the EventHandler >> interface and has the "EventConstants.TOPIC" valorized >> it's not tracked as Event Handler ( i've just put a breakpoint on >> org.eclipse.equinox.internal.event.EventHandlerTracker", and the add >> service method >> is not called when the component factories create the instance of >> mine component.. ) >> >> Any idea about that???? Could this be a bug???? >> >> At the momnent i'm using equinox 3.5 ( M7 ) version. >> >> >> My ds xml file looks like this: >> <?xml version="1.0" encoding="UTF-8"?> >> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" >> name="org.my.components.factory" >> factory="my.componentfactory"> >> <implementation class="org.my.components.MyComponent"/> >> <provide interface="org.my.core.IMyService"/> >> <provide interface="org.osgi.service.event.EventHandler"/> >> </service> >> </scr:component> >> >> Thanks >> _______________________________________________ >> OSGi Developer Mail List >> [email protected] >> https://mail.osgi.org/mailman/listinfo/osgi-dev >> > _______________________________________________ OSGi Developer Mail List [email protected] https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________ OSGi Developer Mail List [email protected] https://mail.osgi.org/mailman/listinfo/osgi-dev
