public CamelPlugin( ServletBuilder servletBuilder, Collection<DataSourceInitializer> dataSourceInitializers, Collection<CamelContextCustomizer> camelContextCustomizers) throws Exception { this.servletBuilder = servletBuilder; this.dataSourceInitializers = dataSourceInitializers; this.camelContextCustomizers = camelContextCustomizers; httpServlet = new CamelHttpTransportServlet(); httpServlet.init(servletBuilder.servletConfig("CamelServlet", new Properties())); camelServlet = servletBuilder.servlet(httpServlet, "/camel/*"); }
@PreDestroy public void stop() throws Exception { httpServlet.destroy(); camelContext.stop(); }