Package org.apache.servicemix.jbi.container

Examples of org.apache.servicemix.jbi.container.ActivationSpec


        .setStreamingEnabled(streaming);
    container.activateComponent(component, "HTTPComponent");

    // Add a echo component
    EchoComponent echo = new EchoComponent();
    ActivationSpec asReceiver = new ActivationSpec("echo", echo);
    asReceiver.setService(new QName("test", "echo"));
    container.activateComponent(asReceiver);

    // Add the http receiver
    HttpConnector connector = new HttpConnector("localhost", 8192);
    connector.setDefaultInOut(true);
    ActivationSpec asConnector = new ActivationSpec("connector", connector);
    asConnector.setDestinationService(new QName("test", "echo"));
    container.activateComponent(asConnector);

    // Start container
    container.start();
View Full Code Here


        ((HttpLifeCycle) component.getLifeCycle()).getConfiguration().setStreamingEnabled(streaming);
        container.activateComponent(component, "HTTPComponent");
       
        // Add a receiver component
        Receiver receiver = new ReceiverComponent();
        ActivationSpec asReceiver = new ActivationSpec("receiver", receiver);
        asReceiver.setService(new QName("http://http.servicemix.org/Test", "ConsumerInOnly"));
        container.activateComponent(asReceiver);
       
        // Add the http invoker
        HttpInvoker invoker = new HttpInvoker();
        invoker.setDefaultInOut(false);
        invoker.setUrl("http://localhost:8192/InOnly/");
        invoker.setMarshaler(new HttpSoapClientMarshaler(true));
        ActivationSpec asInvoker = new ActivationSpec("invoker", invoker);
        asInvoker.setService(new QName("urn:test", "invoker"));
        container.activateComponent(asInvoker);
       
        // Start container
        container.start();
View Full Code Here

import org.springframework.context.support.AbstractXmlApplicationContext;

public class SpringConfigurationTest extends SpringTestSupport {

    public void testConfig() throws Exception {
        ActivationSpec as = new ActivationSpec();
        as.setComponentName("client");
        ServiceMixClient client = new DefaultServiceMixClient(jbi, as);
        InOnly me = client.createInOnlyExchange();
        me.setService(new QName("http://test", "entryPoint"));
        me.getInMessage().setContent(new StringSource("<test xmlns=\"http://test\"><echo/><world/><earth/></test>"));
        client.sendSync(me);
View Full Code Here

        ((HttpLifeCycle) component.getLifeCycle()).getConfiguration().setStreamingEnabled(streaming);
        container.activateComponent(component, "HTTPComponent");
       
        // Add a receiver component
        EchoComponent echo = new EchoComponent();
        ActivationSpec asReceiver = new ActivationSpec("echo", echo);
        asReceiver.setService(new QName("http://http.servicemix.org/Test", "ConsumerInOut"));
        container.activateComponent(asReceiver);
       
        // Add the http invoker
        HttpInvoker invoker = new HttpInvoker();
        invoker.setDefaultInOut(true);
        invoker.setUrl("http://localhost:8192/InOut/");
        ActivationSpec asInvoker = new ActivationSpec("invoker", invoker);
        asInvoker.setService(new QName("urn:test", "invoker"));
        container.activateComponent(asInvoker);
       
        // Start container
        container.start();
View Full Code Here

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        StockQuoteResponse r = new StockQuoteResponse();
        r.setResult(8.23f);
        JAXBContext.newInstance(StockQuoteResponse.class).createMarshaller().marshal(r, baos);
        mock.setResponseXml(baos.toString());
        ActivationSpec as = new ActivationSpec();
        as.setComponent(mock);
        container.activateComponent(as);
       
        // Start container
        container.start();
       
View Full Code Here

        }
    }

    public void testWithNonStandaloneWsdl() throws Exception {
        // Add a receiver component
        ActivationSpec asEcho = new ActivationSpec("echo", new EchoComponent() {
            public Document getServiceDescription(ServiceEndpoint endpoint) {
                try {
                    Definition def = WSDLFactory.newInstance().newDefinition();
                    PortType type = def.createPortType();
                    type.setUndefined(false);
                    type.setQName(new QName("http://porttype.test", "MyConsumerInterface"));
                    def.setTargetNamespace("http://porttype.test");
                    def.addNamespace("tns", "http://porttype.test");
                    def.addPortType(type);
                    Document doc = WSDLFactory.newInstance().newWSDLWriter().getDocument(def);
                    return doc;
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
        });
        asEcho.setEndpoint("myConsumer");
        asEcho.setService(new QName("http://test", "MyConsumerService"));
        container.activateComponent(asEcho);
       
        // HTTP Component
        HttpEndpoint ep = new HttpEndpoint();
        ep.setService(new QName("http://test", "MyConsumerService"));
View Full Code Here

        jbi.init();
        jbi.start();

        wsnComponent = new WSNComponent();
        wsnComponent.setConnectionFactory(new ActiveMQConnectionFactory("vm://localhost"));
        ActivationSpec as = new ActivationSpec();
        as.setComponentName("servicemix-wsn2005");
        as.setComponent(wsnComponent);
        jbi.activateComponent(as);

        wsnBroker = new NotificationBroker(jbi);
        wsnCreatePullPoint = new CreatePullPoint(jbi);
    }
View Full Code Here

        URL url = getClass().getClassLoader().getResource("subscription/subscribe.xml");
        File path = new File(new URI(url.toString()));
        path = path.getParentFile();
        wsnComponent.getServiceUnitManager().deploy("subscription", path.getAbsolutePath());

        ActivationSpec consumer = new ActivationSpec();
        consumer.setService(new QName("http://www.consumer.org", "service"));
        consumer.setEndpoint("endpoint");
        Receiver receiver = new ReceiverComponent();
        consumer.setComponent(receiver);
        jbi.activateComponent(consumer);

        wsnComponent.getServiceUnitManager().start("subscription");

        wsnBroker.notify("myTopic", parse("<hello>world</hello>"));
View Full Code Here

        };
    }

    @Override
    protected void appendJbiActivationSpecs(List<ActivationSpec> activationSpecList) {
        ActivationSpec activationSpec = new ActivationSpec();
        activationSpec.setId("jbiReceiver");
        activationSpec.setService(new QName("serviceNamespace", "serviceA"));
        activationSpec.setEndpoint("endpointA");
        activationSpec.setComponent(receiverComponent);
        activationSpecList.add(activationSpec);
    }
View Full Code Here

        CamelJbiComponent component = new CamelJbiComponent();

        List<ActivationSpec> activationSpecList = new ArrayList<ActivationSpec>();

        // lets add the Camel endpoint
        ActivationSpec activationSpec = new ActivationSpec();
        activationSpec.setId("camel");
        activationSpec.setService(new QName("camel", "camel"));
        activationSpec.setEndpoint("camelEndpoint");
        activationSpec.setComponent(component);
        activationSpecList.add(activationSpec);

        appendJbiActivationSpecs(activationSpecList);

        ActivationSpec[] activationSpecs = activationSpecList
View Full Code Here

TOP

Related Classes of org.apache.servicemix.jbi.container.ActivationSpec

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.