Examples of CamelServlet


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

    }
   
    @SuppressWarnings("rawtypes")
    public void register(CamelServlet provider, Map properties) {
        LOG.debug("Registering provider through OSGi service listener {}", properties);
        CamelServlet camelServlet = (CamelServlet)provider;
        camelServlet.setServletName((String) properties.get("servlet-name"));
        register(camelServlet);
    }
View Full Code Here

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

    public void setCamelServlet(CamelServlet servlet) {
        camelServlet = servlet;
    }

    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

                httpConnectionManager, clientConfigurer);
    }
   
    public void connect(HttpConsumer consumer) throws Exception {
        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

        servlet.connect(consumer);
    }

    public void disconnect(HttpConsumer consumer) throws Exception {
        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

            applicationContext.stop();
        }
    }
   
    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

   
    @Test
    public void testMultiServletsConsumers() throws Exception {
        // this bit is needed because the default servlet chosen (when none is specified)
        // differs in various JDK versions
        CamelServlet camelServlet = CamelHttpTransportServlet.getCamelServlet(null);
        String helloServiceServlet = camelServlet.getServletName().contains("2") ? "2" : "1";
       
        String result = getService("/services" + helloServiceServlet + "/hello");
        assertEquals("Get a wrong response", "/mycontext/services" + helloServiceServlet + "/hello", result);
       
        result = getService("/services1/echo");
View Full Code Here

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

    }

    // Implementation methods
    // -------------------------------------------------------------------------
    protected CamelServlet createServletForConnector(Server server, Connector connector, List<Handler> handlers) throws Exception {
        CamelServlet camelServlet = new CamelServlet();

        Context context = new Context(server, "/", Context.NO_SECURITY | Context.NO_SESSIONS);
        context.setConnectorNames(new String[] {connector.getName()});

        if (handlers != null) {
View Full Code Here

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

    public void setSslSocketConnector(SslSocketConnector connector) {
        sslSocketConnector = connector;
    }

    protected CamelServlet createServletForConnector(Server server, Connector connector, List<Handler> handlers) throws Exception {
        CamelServlet camelServlet = new CamelServlet(isMatchOnUriPrefix());

        Context context = new Context(server, "/", Context.NO_SECURITY | Context.NO_SESSIONS);
        context.setConnectorNames(new String[] {connector.getName()});

        if (handlers != null) {
View Full Code Here

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

        camelServlet = servlet;
    }
       
   
    public CamelServlet getCamelServlet(String servletName) {
        CamelServlet answer = null;
        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 {
        ServletEndpoint endpoint = (ServletEndpoint) consumer.getEndpoint();
        CamelServlet servlet = getCamelServlet(endpoint.getServletName());
        ObjectHelper.notNull(servlet, "CamelServlet");
        servlet.connect(consumer);
    }
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.