@Override public String toString() { String name = getServletName(); if (name != null) { return "CamelHttpTransportServlet[name=" + getServletName() + "]"; } else { return "CamelHttpTransportServlet"; } } }
@Override public void destroy() { DefaultHttpRegistry.removeHttpRegistry(getServletName()); if (httpRegistry != null) { httpRegistry.unregister(this); httpRegistry = null; } LOG.info("Destroyed CamelHttpTransportServlet[{}]", getServletName()); }
/** * Configures servlet for HTTP communication. * * @return registration bean of {@link CamelHttpTransportServlet}. */ @Bean(name = RouteConstants.CAMEL_SERVLET) @ConditionalOnMissingBean(name = RouteConstants.CAMEL_SERVLET) public ServletRegistrationBean camelHttpServlet() { CamelHttpTransportServlet servlet = new CamelHttpTransportServlet(); servlet.setServletName(RouteConstants.CAMEL_SERVLET); ServletRegistrationBean bean = new ServletRegistrationBean(servlet, RouteConstants.HTTP_URI_PREFIX_MAPPING); bean.setName(servlet.getServletName()); return bean; }
@Override public void connect(HttpConsumer consumer) { ServletEndpoint endpoint = getServletEndpoint(consumer); if (endpoint.getServletName() != null && endpoint.getServletName().equals(getServletName())) { super.connect(consumer); } }
LOG.info("Initialized CamelHttpTransportServlet[name={}, contextPath={}]", getServletName(), contextPath);
@Validate public void start() throws ServletException, NamespaceException { CamelHttpTransportServlet srvlet = new CamelHttpTransportServlet(); httpSevlet.registerServlet("/sally", srvlet, null, null); httpSevlet.registerResources("/sally/static", "/static", null); servletComponent = new ServletComponent(); servletComponent.setServletName(srvlet.getServletName()); log.info("SallyURL "+SallyURL+ " "); }
@Validate public void start() throws ServletException, NamespaceException { CamelHttpTransportServlet srvlet = new CamelHttpTransportServlet(); httpSevlet.registerServlet("/sally", srvlet, null, null); httpSevlet.registerResources("/sally/jobad", "/app/jobad", null); httpSevlet.registerResources("/sally/client", "/app/client", null); ServletComponent servletComponent = new ServletComponent(); servletComponent.setServletName(srvlet.getServletName()); camelContextProvider.registerGlobalComponent("sallyservlet", servletComponent); }