So Blueprint "reference-list" may be relevant:
 <reference-list interface="MyCallbackContract" availability="optional">
  <reference-listener ref="myJPAStuff" bind-method="addCallback" 
unbind-method="removeCallback" />
 </reference-list>

Where "removeCallback" method may be called with a null parameter at startup 
which means no service was found at that time.

JP

[@@ OPEN @@]

-----Message d'origine-----
De : ellirael [mailto:ellir...@mail.ru] 
Envoyé : vendredi 19 juin 2015 13:42
À : user@karaf.apache.org
Objet : RE: Best way to access OSGi services from classes which object creation 
I cannot handle

Jean-Philippe, dynamic change of services impl have many ways to use.
For example I can dynamically register calback methods, hot-update app version 
without needs of app stopping, implementing point of extension template.

In different cases there will be different requirements how to handle services 
change, removing and creating.

For now my task is to call special services if it exists. If it not exists then 
ignore. If it changes it must be no need of some sort of app stop. It must just 
to start call new services impl.




--
View this message in context: 
http://karaf.922171.n3.nabble.com/Best-way-to-access-OSGi-services-from-classes-which-object-creation-I-cannot-handle-tp4040986p4040995.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to