The elegant way is to use the Aries JAXRS Whiteboard.

Christian

Am Mi., 20. Nov. 2019 um 00:54 Uhr schrieb Ranx0r0x <
regis...@bradleejohnson.com>:

> I noticed that when I stopped/uninstalled the bundle the CXF endpoint was
> still up and the bundle couldn't be reinstalled. By saving the Server and
> destroying it on @Deactivate it correctly went away. There may be a more
> elegant or better way to do this but it may be that it should be part of
> the
> sample code.
>
> @Component
> public class RestServiceBootstrap {
>
>         private MyInjectedService injectedService;
>         private Server server;
>         @Activate
>         public void activate() throws Exception {
>                 System.out.println("Activate the MemberServiceImpl");
>                 JAXRSServerFactoryBean bean = new JAXRSServerFactoryBean();
>                 bean.setAddress("/foo");
>                 bean.setBus(BusFactory.getDefaultBus());
>                 bean.setServiceBean(new RestServiceImpl(injectService));
>                 server = bean.create();
>         }
>
>         @Deactivate
>         public void deactivate() {
>                 System.out.println("Deactivating server: " + server);
>                 server.destroy();
>         }
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>


-- 
-- 
Christian Schneider
http://www.liquid-reality.de

Computer Scientist
http://www.adobe.com

Reply via email to