Examples of CamelServlet


Examples of org.apache.camel.component.http.CamelServlet

                    server.setHandler(handlerCollection);
                }
            }
        }

        CamelServlet camelServlet;
        boolean jetty = endpoint.getUseContinuation() != null ? endpoint.getUseContinuation() : isUseContinuation();
        if (jetty) {
            // use Jetty continuations
            CamelContinuationServlet jettyServlet = new CamelContinuationServlet();
            // configure timeout and log it so end user know what we are using
            Long timeout = endpoint.getContinuationTimeout() != null ? endpoint.getContinuationTimeout() : getContinuationTimeout();
            if (timeout != null) {
                LOG.info("Using Jetty continuation timeout: " + timeout + " millis for: " + endpoint);
                jettyServlet.setContinuationTimeout(timeout);
            } else {
                LOG.info("Using default Jetty continuation timeout for: " + endpoint);
            }

            // use the jetty servlet
            camelServlet = jettyServlet;
        } else {
            // do not use jetty so use a plain servlet
            camelServlet = new CamelServlet();
            LOG.info("Jetty continuation is disabled for: " + endpoint);
        }

        ServletHolder holder = new ServletHolder();
        holder.setServlet(camelServlet);
View Full Code Here

Examples of org.apache.camel.component.http.CamelServlet

    public void setCamelServletService(CamelServletService service) {
        camelServletService = service;
    }

    public CamelServlet getCamelServlet(String servletName) {
        CamelServlet answer;
        if (camelServlet == null) {
            answer = CamelHttpTransportServlet.getCamelServlet(servletName);
        } else {
            answer = camelServlet;
        }
View Full Code Here

Examples of org.apache.camel.component.http.CamelServlet

    public void connect(HttpConsumer consumer) throws Exception {
        if (getCamelServletService() != null) {
            getCamelServletService().connect(consumer);
        } else {
            ServletEndpoint endpoint = (ServletEndpoint) consumer.getEndpoint();
            CamelServlet servlet = getCamelServlet(endpoint.getServletName());
            ObjectHelper.notNull(servlet, "CamelServlet");
            servlet.connect(consumer);
        }
    }
View Full Code Here

Examples of org.apache.camel.component.http.CamelServlet

    public void disconnect(HttpConsumer consumer) throws Exception {
        if (getCamelServletService() != null) {
            getCamelServletService().disconnect(consumer);
        } else {
            ServletEndpoint endpoint = (ServletEndpoint) consumer.getEndpoint();
            CamelServlet servlet = getCamelServlet(endpoint.getServletName());
            ObjectHelper.notNull(servlet, "CamelServlet");
            servlet.disconnect(consumer);
        }
    }
View Full Code Here

Examples of org.apache.camel.component.http.CamelServlet

        // the ApplicationContext is removed
        CAMEL_SERVLET_MAP.remove(servletName);
    }
   
    public static CamelServlet getCamelServlet(String servletName) {
        CamelServlet answer = null;
        if (servletName != null) {
            answer = CAMEL_SERVLET_MAP.get(servletName);
        } else {
            if (CAMEL_SERVLET_MAP.size() > 0) {
                // return the first one servlet
                Iterator<CamelServlet> iterator = CAMEL_SERVLET_MAP.values().iterator();
                answer = iterator.next();
                LOG.info("Since no servlet name is specified, using the first element of camelServlet map [" + answer.getServletName() + "]");
            }
        }       
        return answer;
    }
View Full Code Here

Examples of org.apache.camel.component.http.CamelServlet

                    server.setHandler(handlerCollection);
                }
            }
        }

        CamelServlet camelServlet;
        boolean jetty = endpoint.getUseContinuation() != null ? endpoint.getUseContinuation() : isUseContinuation();
        if (jetty) {
            // use Jetty continuations
            CamelContinuationServlet jettyServlet = new CamelContinuationServlet();
            // configure timeout and log it so end user know what we are using
            Long timeout = endpoint.getContinuationTimeout() != null ? endpoint.getContinuationTimeout() : getContinuationTimeout();
            if (timeout != null) {
                LOG.info("Using Jetty continuation timeout: " + timeout + " millis for: " + endpoint);
                jettyServlet.setContinuationTimeout(timeout);
            } else {
                LOG.info("Using default Jetty continuation timeout for: " + endpoint);
            }

            // use the jetty servlet
            camelServlet = jettyServlet;
        } else {
            // do not use jetty so use a plain servlet
            camelServlet = new CamelServlet();
            LOG.info("Jetty continuation is disabled for: " + endpoint);
        }

        ServletHolder holder = new ServletHolder();
        holder.setServlet(camelServlet);
View Full Code Here

Examples of org.apache.camel.component.http.CamelServlet

                    server.setHandler(handlerCollection);
                }
            }
        }

        CamelServlet camelServlet;
        boolean jetty = endpoint.getUseContinuation() != null ? endpoint.getUseContinuation() : isUseContinuation();
        if (jetty) {
            // use Jetty continuations
            CamelContinuationServlet jettyServlet = new CamelContinuationServlet();
            // configure timeout and log it so end user know what we are using
            Long timeout = endpoint.getContinuationTimeout() != null ? endpoint.getContinuationTimeout() : getContinuationTimeout();
            if (timeout != null) {
                LOG.info("Using Jetty continuation timeout: " + timeout + " millis for: " + endpoint);
                jettyServlet.setContinuationTimeout(timeout);
            } else {
                LOG.info("Using default Jetty continuation timeout for: " + endpoint);
            }

            // use the jetty servlet
            camelServlet = jettyServlet;
        } else {
            // do not use jetty so use a plain servlet
            camelServlet = new CamelServlet();
            LOG.info("Jetty continuation is disabled for: " + endpoint);
        }

        ServletHolder holder = new ServletHolder();
        holder.setServlet(camelServlet);
View Full Code Here

Examples of org.apache.camel.component.http.CamelServlet

                    server.setHandler(handlerCollection);
                }
            }
        }

        CamelServlet camelServlet;
        boolean jetty = endpoint.getUseContinuation() != null ? endpoint.getUseContinuation() : isUseContinuation();
        if (jetty) {
            // use Jetty continuations
            CamelContinuationServlet jettyServlet = new CamelContinuationServlet();
            // configure timeout and log it so end user know what we are using
            Long timeout = endpoint.getContinuationTimeout() != null ? endpoint.getContinuationTimeout() : getContinuationTimeout();
            if (timeout != null) {
                LOG.info("Using Jetty continuation timeout: " + timeout + " millis for: " + endpoint);
                jettyServlet.setContinuationTimeout(timeout);
            } else {
                LOG.info("Using default Jetty continuation timeout for: " + endpoint);
            }

            // use the jetty servlet
            camelServlet = jettyServlet;
        } else {
            // do not use jetty so use a plain servlet
            camelServlet = new CamelServlet();
            LOG.info("Jetty continuation is disabled for: " + endpoint);
        }

        ServletHolder holder = new ServletHolder();
        holder.setServlet(camelServlet);
View Full Code Here

Examples of org.apache.camel.component.http.CamelServlet

        String name = config.getServletName();
        String contextPath = config.getServletContext().getContextPath();

        if (httpRegistry == null) {
            httpRegistry = DefaultHttpRegistry.getHttpRegistry(name);
            CamelServlet existing = httpRegistry.getCamelServlet(name);
            if (existing != null) {
                String msg = "Duplicate ServletName detected: " + name + ". Existing: " + existing + " This: " + this.toString()
                        + ". Its advised to use unique ServletName per Camel application.";
                // always log so people can see it easier
                if (isIgnoreDuplicateServletName()) {
View Full Code Here

Examples of org.apache.camel.component.http.CamelServlet

        sslSocketConnector = connector;
    }


    protected CamelServlet createServletForConnector(Server server, Connector connector, String handlerNames) throws Exception {
        CamelServlet camelServlet = new CamelContinuationServlet();
        Context context = new Context(server, "/", Context.NO_SECURITY | Context.NO_SESSIONS);
        context.setConnectorNames(new String[] {connector.getName()});

        if (handlerNames != null) {
            String[] handlerNameArray = handlerNames.split(",");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.