felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: uses ComponentInstances as part of the Declarative Services specification
Date Tue, 17 Dec 2013 20:44:47 GMT
There is no external notification that the instance has been disposed of.  Assuming your component
has a disposed method, that will get called and you can notify users yourself.  But I would
definitely recommend using a Service instead.

I'm very surprised that an instance obtained from a ComponentFactory is getting recreate automatically
when a static reference becomes unavailable.  I would expect you'd have to create the new
instance yourself.  Are you sure this is what's happening?

Are you aware of how to use config admin with factory pids to create multiple instances of
a component?  This may not be documented all that well but that generally provides component
life cycles that I find more useful.

david jencks

On Dec 17, 2013, at 12:32 PM, "Humeniuk, David P" <David.Humeniuk@udri.udayton.edu>

> We've been using ComponentFactory's and ComponentInstances in our software for a while
when we have a component that we need multiple instances.  However, I've noticed that if a
component has an optional, static reference, the component will be disposed and activated
automatically when the service referenced comes and goes (which is not too surprising based
on the meaning of static) meaning the previous instance is no longer valid.
> The question is, if I have something that uses that instance, how is it supposed to know
about the replaced instance.  I'm guessing that the component instance object should not be
used in this case and I should instead try have the component provide a service and use the
service reference instead??  Is that what is expected or is there some way to be notified
about an updated component instance?
> Thanks,
> Dave Humeniuk

To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org

View raw message