Package org.apache.servicemix.jbi.container

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


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);
       
        int nbMsgs = 10;
        for (int i = 0; i < nbMsgs; i++) {
            InOnly me = client.createInOnlyExchange();
View Full Code Here


        // Wait for all messages to be processed
        Thread.sleep(50);
    }

    public void testConfigAsync() throws Exception {
        ActivationSpec as = new ActivationSpec();
        as.setComponentName("client");
        ServiceMixClient client = new DefaultServiceMixClient(jbi, as);
       
        int nbMsgs = 100;
        for (int i = 0; i < nbMsgs; i++) {
            InOnly me = client.createInOnlyExchange();
View Full Code Here

    }

    @Override
    protected void appendJbiActivationSpecs(
            List<ActivationSpec> activationSpecList) {
        ActivationSpec activationSpec = new ActivationSpec();
        activationSpec.setId("jbiReceiver");
        activationSpec.setService(new QName("serviceNamespace", "serviceB"));
        activationSpec.setEndpoint("endpointB");
        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

        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

    @Override
    protected void appendJbiActivationSpecs(
            List<ActivationSpec> activationSpecList) {
        this.startEndpointUri = "seda:receiver";

        ActivationSpec activationSpec = new ActivationSpec();
        activationSpec.setId("jbiSender");
        activationSpec.setService(new QName("serviceNamespace", "serviceA"));
        activationSpec.setEndpoint("endpointA");

        // lets setup the sender to talk directly to camel
        senderComponent.setResolver(new URIResolver("camel:seda:receiver"));
        activationSpec.setComponent(senderComponent);

        activationSpecList.add(activationSpec);
    }
View Full Code Here

        // HTTP Component
        HttpComponent component = new HttpComponent();
        container.activateComponent(component, "HTTPComponent");

        // 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://test", "MyConsumerInterface"));
                    Binding binding = def.createBinding();
                    binding.setQName(new QName("http://test", "MyConsumerBinding"));
                    binding.setUndefined(false);
                    binding.setPortType(type);
                    Service svc = def.createService();
                    svc.setQName(new QName("http://test", "MyConsumerService"));
                    Port port = def.createPort();
                    port.setBinding(binding);
                    port.setName("myConsumer");
                    svc.addPort(port);
                    def.setTargetNamespace("http://test");
                    def.addNamespace("tns", "http://test");
                    def.addPortType(type);
                    def.addBinding(binding);
                    def.addService(svc);
                    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);

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

        // Add a jms receiver
        JmsReceiverComponent jmsReceiver = new JmsReceiverComponent();
        jmsTemplate.setDefaultDestinationName("queue/A");
        jmsReceiver.setTemplate(jmsTemplate);
        jmsReceiver.afterPropertiesSet();
        ActivationSpec asJmsReceiver = new ActivationSpec("jmsReceiver", jmsReceiver);
        asJmsReceiver.setDestinationService(new QName("test", "receiver"));
        container.activateComponent(asJmsReceiver);

        // Add a receiver component
        Receiver receiver = new ReceiverComponent();
        ActivationSpec asReceiver = new ActivationSpec("receiver", receiver);
        asReceiver.setService(new QName("test", "receiver"));
        container.activateComponent(asReceiver);

        // Deploy SU
        URL url = getClass().getClassLoader().getResource("provider/jms.wsdl");
        File path = new File(new URI(url.toString()));
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.