Hi Peter,
Thank you very much for suggestion, i've just look at the
ManagedServiceFactory.
I've choose the DS approach only beacuse the components (tha provide
services ) could have
dependencies on other services and ds help a lot in managing service
dependencies.
I like very much the DS approach because it's very light and in very few
time i was able to have
what described in previous mail.
For me DS component factories are not so bad, the problem is that
there's not so much
documentation, the only way to learn is to look at the specification.
Somewhere i've read that when "if you're using DS then you don't need to
explcitly provide a ManagedService or ManagedServiceFactory
implementation. The SCR will automatically merge configuration
properties with component properties."
I think in the next day i'll investigate this in detail trying to solve
the problem, btw having some
detailed tutorial on DS, DS factories and the relation with the CM could
be very useful for
all.
Just my two cents
Andrea
Peter Kriens ha scritto:
It sounds to me that your problem could also map rather nicely to a
Managed Service Factory?
I always disliked DS factories, so I a biased :-)
Kind regards,
Peter Kriens
On 5 mei 2009, at 11:17, Andrea Zoppello wrote:
Hi Neill,
Thank you for your support.
Do i need to take care myself about component instance objects or
it's possible to retrieve them in some
way from OSGi framework???
Another point tham i'm still a little confused is the
interoperability of DS and CM.
As you know i want to create my components with component factories
this will happen with deployment file
on some folder, now
1) Creating components/services ( ok is done by component factories
invoked by my deployer-service )
2) Unregistering is done by ComponentInstance.dispose()
Now the last part i miss i the "update" of the component when the
deployment file is update. My idea is that
my component will provide the ManagedServiceInterface.
Is this the right way to proceed???
Bye
Andrea
Neil Bartlett ha scritto:
Andrea,
To create the component instances you must have called newInstance()
on ComponentFactory. This returns an object of type
ComponentInstance... to destroy the instance and unregister its
services, just call the dispose() method on ComponentInstance.
Regards,
Neil
On Tue, May 5, 2009 at 9:40 AM, Andrea Zoppello
<[email protected]> wrote:
Hi all,
I've developed a ds component factory that create instances of my
component
on demand, my component
provide a service according to a particulare java interface
But in my requirements i need both "create" and "remove component
instances"
depending for example by
adding ( creating components/services ) or removing ( removing the
related
components/services ) files
from a specified folder.
I've just achieved the creating use case writing a component that
mantains
the reference to the component factories and
provide to create my components on demand....
What i need now is to have a way to undeploy some of this when "the
related
deployment" file is removed
by the deployment folder.
Which is the best way to do that???? I know services are automatically
unregistered when the bundle that create that service stop,
but in my case i'm using ds and a component factory so it's not
clear wich
is the right way to proceed.
Thank you for your help...
Andrea
_______________________________________________
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
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev