Package org.apache.servicemix.jbi.container

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


     * @return a message exchange factory
     */
    public MessageExchangeFactory createExchangeFactory() {
        MessageExchangeFactoryImpl result = createMessageExchangeFactory();
        result.setContext(context);
        ActivationSpec activationSpec = context.getActivationSpec();
        if (activationSpec != null) {
            String componentName = context.getComponentNameSpace().getName();
            // lets auto-default the container-routing information
            QName serviceName = activationSpec.getDestinationService();
            if (serviceName != null) {
                result.setServiceName(serviceName);
                LOG.debug("default destination serviceName for " + componentName + " = " + serviceName);
            }
            QName interfaceName = activationSpec.getDestinationInterface();
            if (interfaceName != null) {
                result.setInterfaceName(interfaceName);
                LOG.debug("default destination interfaceName for " + componentName + " = " + interfaceName);
            }
            QName operationName = activationSpec.getDestinationOperation();
            if (operationName != null) {
                result.setOperationName(operationName);
                LOG.debug("default destination operationName for " + componentName + " = " + operationName);
            }
            String endpointName = activationSpec.getDestinationEndpoint();
            if (endpointName != null) {
                boolean endpointSet = false;
                LOG.debug("default destination endpointName for " + componentName + " = " + endpointName);
                if (serviceName != null && endpointName != null) {
                    endpointName = endpointName.trim();
View Full Code Here


        endpoint.setServiceInterface(ComplexPojo.class.getName());
        component.setEndpoints(new Jsr181Endpoint[] {endpoint });
        container.activateComponent(component, "JSR181Component");
       
        EchoComponent echo = new EchoComponent();
        ActivationSpec as = new ActivationSpec();
        as.setComponent(echo);
        as.setService(ReceiverComponent.SERVICE);
        as.setComponentName("Echo");
        container.activateComponent(as);
       
        container.start();

        DefaultServiceMixClient client = new DefaultServiceMixClient(container);
View Full Code Here

        endpoint.setServiceInterface(ComplexPojo.class.getName());
        component.setEndpoints(new Jsr181Endpoint[] {endpoint });
        container.activateComponent(component, "JSR181Component");
       
        EchoComponent echo = new EchoComponent();
        ActivationSpec as = new ActivationSpec();
        as.setComponent(echo);
        as.setService(ReceiverComponent.SERVICE);
        as.setComponentName("Echo");
        container.activateComponent(as);
       
        container.start();

        DefaultServiceMixClient client = new DefaultServiceMixClient(container);
View Full Code Here

    }

    private void activateComponent() throws Exception {
        ComponentContextImpl cc = new ComponentContextImpl(container, new ComponentNameSpace(container.getName(), "ODE"));
        ActivationSpec activationSpec = new ActivationSpec();
        activationSpec.setComponent(component);
        activationSpec.setComponentName("ODE");
        container.activateComponent(odeDir, component, "", cc, activationSpec,  true, false, false, null);
    }
View Full Code Here

          broker.stop();
        }
    }
   
    public void testInOut() throws Exception {
        ActivationSpec as = new ActivationSpec();
        as.setId("saaj");
        SaajBinding saaj = new SaajBinding();
        saaj.setSoapEndpoint(new URLEndpoint("http://localhost:" + PORT_WS_1));
        as.setComponent(saaj);
        as.setService(new QName("saaj"));
        container.activateComponent(as);
       
        as = new ActivationSpec();
        as.setId("xfireBinding");
        as.setComponent(new HttpSoapConnector(null, PORT_2, true));
        as.setDestinationService(new QName("saaj"));
        container.activateComponent(as);
       
        as = new ActivationSpec();
        as.setId("webservice");
        as.setComponent(new HttpConnector(null, PORT_WS_2));
        as.setDestinationService(new QName("mock"));
        container.activateComponent(as);
       
        as = new ActivationSpec();
        as.setId("mock");
        MockServiceComponent mock = new MockServiceComponent();
        mock.setResponseResource(new ClassPathResource("soap-response.xml", getClass()));
        as.setComponent(mock);
        as.setService(new QName("mock"));
        container.activateComponent(as);

        URLConnection connection = new URL("http://localhost:" + PORT_1).openConnection();
        connection.setDoOutput(true);
        connection.setDoInput(true);
View Full Code Here

                    }
                }
            };
        }

        senderContainer.activateComponent(new ActivationSpec("sender", sender));
        senderContainer.activateComponent(new ActivationSpec("receiver", receiver));

        tt.execute(new TransactionCallback() {
            public Object doInTransaction(TransactionStatus status) {
                try {
                    sender.sendMessages(numMessages, syncSend);
View Full Code Here

            protected void process(MessageExchange exchange, NormalizedMessage message) throws MessagingException {
                LOGGER.info("Received: {}", message);
                done(exchange);
            }
        };
        ActivationSpec as = new ActivationSpec("out", out);
        as.setService(new QName("out"));
        container.activateComponent(as);
        client = new DefaultServiceMixClient(container);
    }
View Full Code Here

        container.setFlowName("seda");
        container.init();
        container.start();

        sender = new SenderComponent();
        ActivationSpec as = new ActivationSpec("source", sender);
        as.setService(new QName("http://www.test.com", "source"));
        as.setFailIfNoDestinationEndpoint(false);
        container.activateComponent(as);
    }
View Full Code Here

        sender.sendMessages(1, false);
        recListener.getMessageList().assertMessagesReceived(1);
    }

    private ActivationSpec createReceiverAS(String id, Object component) {
        ActivationSpec as = new ActivationSpec(id, component);
        SubscriptionSpec ss = new SubscriptionSpec();
        ss.setService(new QName("http://www.test.com", "source"));
        as.setSubscriptions(new SubscriptionSpec[] {ss });
        as.setFailIfNoDestinationEndpoint(false);
        return as;
    }
View Full Code Here

        as.setFailIfNoDestinationEndpoint(false);
        return as;
    }

    private ActivationSpec createReceiverASFiltered(String id, Object component) {
        ActivationSpec as = new ActivationSpec(id, component);
        SubscriptionSpec ss = new SubscriptionSpec();
        ss.setService(new QName("http://www.test.com", "source"));
        ss.setFilter(new Filter());
        as.setSubscriptions(new SubscriptionSpec[] {ss });
        as.setFailIfNoDestinationEndpoint(false);
        return as;
    }
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.