You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Jean-Baptiste Onofré (Jira)" <ji...@apache.org> on 2019/11/20 05:19:00 UTC

[jira] [Updated] (KARAF-6523) Cleanly destroy the CXF server in the REST/SOAP examples

     [ https://issues.apache.org/jira/browse/KARAF-6523?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jean-Baptiste Onofré updated KARAF-6523:
----------------------------------------
    Summary: Cleanly destroy the CXF server in the REST/SOAP examples  (was: Destroy the CXF server in the JAXRS SCR example)

> 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)