Hi BJ
SO i checked my configuration:
My packages are not exporting "org.osgi.service.event" packages so i
really do not understan why the Event Handler Tracker cannot see my
services...
With OSGi console i checked the package with the pacakages command this
is the reult:
org.osgi.service.event;
version="1.2.0"<org.eclipse.osgi.services_3.2.0.v20090306-1900 [74]>
org.eclipse.equinox.app_1.2.0.v20090306-1900 [41] imports
org.eclipse.equinox.cm_1.0.100.v20090306-1900 [42] imports
org.eclipse.equinox.event_1.1.100.v20090306-1900 [47] imports
org.eclipse.equinox.log_1.1.100.v20090306-1900 [57] imports
org.eclipse.equinox.useradmin_1.1.100.v20090306-1900 [68] imports
org.eclipse.equinox.wireadmin_1.0.100.v20090306-1900 [70] imports
org.spagic3.core_1.0.0 [88] imports
org.spagic3.deployer_1.0.0 [89] imports
As you see the version of org.osgi.service.event exported is 1.2.0 and
it seems this is used both by
"org.eclipse.equinox.event_1.1.100.v20090306-1900"
and by mine bundles so i really do not understand where's the problem.
What'is strange is that in my bundle called "org.spagic3.core_1.0.0
[88]" i've my abstract class tha implement the EventHandler interface,
but the real component class, and the component factory are in another
bundle that is not listed beacuse it's not importing the
"org.osgi.service.event" package.
I'll try to import the package in the bundle defining the real component
class... and let you know.
Thank for the help..
Andrea
BJ Hargrave ha scritto:
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_ <http://www.osgi.org/>_
[email protected]_ <mailto:[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
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev