Package org.apache.servicemix.jbi.container

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


        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);
    }
View Full Code Here


        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");
        jbi.activateComponent(new ActivationSpec("receiver", receiver));

        EndpointReferenceType epr = new EndpointReferenceType();
        epr.setAddress(new AttributedURIType());
        epr.getAddress().setValue("http://localhost:8192/Receiver/?http.soap=true");
        wsnBroker.subscribe(epr, "myTopic", null);
View Full Code Here

        }
    }

    protected void testWSDL(final Definition def, int portNumber) throws Exception {
        // Add a receiver component
        ActivationSpec asEcho = new ActivationSpec("echo", new EchoComponent() {
            public Document getServiceDescription(ServiceEndpoint endpoint) {
                try {
                    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

        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

     * @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

        // JMS Component
        JmsComponent component = new JmsComponent();
        container.activateComponent(component, "JMSComponent2");
       
        // 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.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);
                    return WSDLFactory.newInstance().newWSDLWriter().getDocument(def);
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
        });
        asEcho.setEndpoint("myConsumer");
        asEcho.setService(new QName("http://test", "MyConsumerService"));
        container.activateComponent(asEcho);

        // Deploy SU
        URL url = getClass().getClassLoader().getResource("xbean/xbean.xml");
        File path = new File(new URI(url.toString()));
View Full Code Here

        component.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

        component.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

            getSubscriptionManager().dispatchToSubscribers(exchange);
        }

        if (!foundRoute) {
            boolean throwException = true;
            ActivationSpec activationSpec = exchange.getActivationSpec();
            if (activationSpec != null) {
                throwException = activationSpec.isFailIfNoDestinationEndpoint();
            }
            if (throwException) {
                throw new MessagingException("Could not find route for exchange: " + exchange + " for service: " + exchange.getService()
                                + " and interface: " + exchange.getInterfaceName());
            } else if (exchange.getMirror().getSyncState() == MessageExchangeImpl.SYNC_STATE_SYNC_SENT) {
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.