Package org.apache.servicemix.http

Examples of org.apache.servicemix.http.HttpComponent


            return new ByteArrayRequestEntity(baos.toByteArray(), writer.getContentType());
        }
    }

    protected HttpClient getClient() {
        HttpComponent comp =  (HttpComponent) endpoint.getServiceUnit().getComponent();
        return comp.getClient();
    }
View Full Code Here


        if (path.lastIndexOf('/') >= 0) {
            path = path.substring(path.lastIndexOf('/') + 1);
        }

        // Set protocol, host, and port in the component
        HttpComponent comp = (HttpComponent) endpoint.getServiceUnit().getComponent();
        comp.setProtocol(request.getScheme());
        comp.setHost(request.getServerName());
        comp.setPort(request.getServerPort());
        comp.setPath(request.getContextPath());

        // Reload the wsdl
        endpoint.reloadWsdl();

        Node node = (Node) endpoint.getWsdls().get(path);
View Full Code Here

        }
        return headers;
    }
   
    protected ContextManager getServerManager() {
        HttpComponent comp =  (HttpComponent) endpoint.getServiceUnit().getComponent();
        return comp.getServer();
    }
View Full Code Here

    protected void addResource(String path, Object resource) {
        resources.put(path, resource);
    }

    protected ContextManager getServerManager() {
        HttpComponent comp = (HttpComponent) getServiceUnit().getComponent();
        return comp.getServer();
    }
View Full Code Here

    AbstractProcessor(HttpEndpoint endpoint) {
        this.endpoint = endpoint;
    }

    protected HttpConfiguration getConfiguration() {
        HttpComponent comp = (HttpComponent) endpoint.getServiceUnit().getComponent();
        return comp.getConfiguration();
    }
View Full Code Here

            jbi.activateComponent(bank);
        }
    }

    protected void registerHttp() throws Exception {
        HttpComponent http = new HttpComponent();
        HttpEndpoint ep = new HttpEndpoint();
        ep.setSoap(true);
        ep.setDefaultMep(MessageExchangeSupport.IN_OUT);
        ep.setRoleAsString("consumer");
        ep.setService(new QName("urn:logicblaze:soa:loanbroker", "LoanBrokerService"));
        ep.setEndpoint("loanbroker");
        ep.setLocationURI("http://localhost:8192");
        http.setEndpoints(new HttpEndpoint[] {ep });
        jbi.activateComponent(http, "http");
    }
View Full Code Here

        SerializedMarshaler marshaler = new SerializedMarshaler();
        marshaler.setDefaultMep(MessageExchangeSupport.IN_OUT);
        ep.setMarshaler(marshaler);

        // Add the endpoint to the component and activate it
        HttpComponent component = new HttpComponent();
        component.setEndpoints(new HttpEndpointType[] {ep});
        container.activateComponent(component, "HttpConsumer");

        // Dummy up a component as a receiver and route it to urn:HttpInvoker/Endpoint
        TransformComponentSupport rmiComponent = new TransformComponentSupport() {
            protected boolean transform(MessageExchange exchange, NormalizedMessage in, NormalizedMessage out)
View Full Code Here

            jmsBroker.stop();
        }
    }

    public void testDynamicSubscription() throws Exception {
        HttpComponent httpComponent = new HttpComponent();

        HttpEndpoint httpWSNBroker = new HttpEndpoint();
        httpWSNBroker.setService(new QName("http://servicemix.org/wsnotification", "NotificationBroker"));
        httpWSNBroker.setEndpoint("Broker");
        httpWSNBroker.setRoleAsString("consumer");
        httpWSNBroker.setLocationURI("http://localhost:8192/WSNBroker/");
        httpWSNBroker.setSoap(true);

        HttpEndpoint httpReceiver = new HttpEndpoint();
        httpReceiver.setService(new QName("receiver"));
        httpReceiver.setEndpoint("endpoint");
        httpReceiver.setLocationURI("http://localhost:8192/Receiver/");
        httpReceiver.setDefaultMep(SoapHelper.IN_ONLY);
        httpReceiver.setSoap(true);

        httpComponent.setEndpoints(new HttpEndpoint[] { httpWSNBroker, httpReceiver });
        jbi.activateComponent(new ActivationSpec("servicemix-http", httpComponent));

        ReceiverComponent receiver = new ReceiverComponent();
        receiver.setService(new QName("receiver"));
        receiver.setEndpoint("endpoint");
View Full Code Here

            throw (IOException) new IOException(e.getMessage()).initCause(e);
        }
    }

    protected org.mortbay.jetty.client.HttpClient getConnectionPool() {
        HttpComponent comp =  (HttpComponent) getServiceUnit().getComponent();
        return comp.getConnectionPool();
    }
View Full Code Here

        }
    }

    protected org.mortbay.jetty.client.HttpClient getConnectionPool() throws Exception {
        if (jettyClient == null) {
            HttpComponent comp = (HttpComponent) getServiceUnit().getComponent();
            if (comp.getConfiguration().isJettyClientPerProvider()) {
                jettyClient = comp.getNewJettyClient(comp);
            } else {
                //return shared client
                jettyClient = comp.getConnectionPool();
            }
            jettyClient.setSoTimeout(getClientSoTimeout());
        }
        return jettyClient;
    }
View Full Code Here

TOP

Related Classes of org.apache.servicemix.http.HttpComponent

Copyright © 2018 www.massapicom. 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.