Question

Servicemix expert. I need some guidance. Below is my problem scenario.

A web application(webapp1) is running in tomcat container and on same machine servicemix(v4.5.3) is executing. I have already deployed web service(ws1) on servicemix using apache cxf . I hit the web service(ws1) from my webapplication(webapp1). It's working fine. Now, my problem is I want to start another already installed bundle(simple java application) on servicemix programmatically. I want to write business logic to start bundle in web service(ws1) so that when I hit webservice(ws1), it starts that bundle.

Need some suggestion please.

Était-ce utile?

La solution

If your Web Service bundle deployed to ServiceMix is using Spring configuration, you can get access to a BundleContext simply by adding a property (and setter method) to any bean:

<property name="bundleContext" ref="bundleContext" />

The BundleContext gives you access to a range of things, in your instance use either the getBundle or getBundles method to get the required Bundle object, then issue start/stop etc.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top