[
https://issues.apache.org/jira/browse/KARAF-6523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16980693#comment-16980693
]
ASF GitHub Bot commented on KARAF-6523:
---------------------------------------
jbonofre commented on pull request #998: [KARAF-6523] Cleanly destroy CXF
server in REST/SOAP examples
URL: https://github.com/apache/karaf/pull/998
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Cleanly destroy the CXF server in the REST/SOAP examples
> --------------------------------------------------------
>
> Key: KARAF-6523
> URL: https://issues.apache.org/jira/browse/KARAF-6523
> Project: Karaf
> Issue Type: Bug
> Components: karaf
> Reporter: Jean-Baptiste Onofré
> Assignee: Jean-Baptiste Onofré
> Priority: Major
> Fix For: 4.3.0, 4.2.8
>
>
> In the karaf-rest-example-scr, we should add {{@Deactivate}} method to
> destroy the CXF RS server.
> It should look like:
> {code:java}
> @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();
> }
> } {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)