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 04:24:00 UTC

[jira] [Created] (KARAF-6523) Destroy the CXF server in the JAXRS SCR example

Jean-Baptiste Onofré created KARAF-6523:
-------------------------------------------

             Summary: Destroy the CXF server in the JAXRS SCR example
                 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é
             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)