Your mixing two different approaches here.
Either register your services by means of an Activator or by using the
Blueprint-Extender.
As you're using a blueprint.xml the blueprint-Extender automatically kicks
in and starts the bundle for you, so no need to use the Activator any
longer and therefore the Activator isn't called.

regards, Achim

2015-03-29 23:18 GMT+02:00 Pat Warren <[email protected]>:

> Hi,
>
> I implemented a Service and leveraged declarative registration using
> Blueprint (via blueprint.xml).
>
> ...
> <service id="aService"
>            interface="AService"
>            ref="aServiceImpl">
>        <registration-listener ref="activator"
> registration-method="register"
> unregistration-method="unregister"/>
> </service>
> ...
> The service deploys fine and if I do service:list in the Karaf command
> prompt I see the service successfully installed and started. However, the
> activator's registration and unregistration callback methods are not
> getting
> invoked.
>
> Clearly, I am not doing something right and would appreciate any insights.
>
> public class Activator implements BundleActivator {
>
> //  ... start and stop methods  removed for brevity ...
>
>         public void register(final AService aServ, final Map properties) {
>                 System.out.println("Register invoked...");
>         }
>
>         public void unregister(final AService aServ, final Map properties)
> {
>                 System.out.println("Unregister called...");
>         }
> }
>
> There isnt anything in the log to indicate any attempts to call register or
> unregister, i.e., no failures on trying to call these methods. It appears
> that no callback is not happening
>
> Thanks for any help.
>
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Karaf-3-0-3-Blueprint-Service-Registration-Listener-related-question-tp4039368.html
> Sent from the Karaf - Dev mailing list archive at Nabble.com.
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master

Reply via email to