Package org.apache.servicemix.jbi.container

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


        }
    }
   
    public void testInOut() throws Exception {
        int PORT = 7012;
        ActivationSpec as = new ActivationSpec();
        as.setId("echo");
        as.setComponent(new EchoComponent());
        as.setService(new QName("echo"));
        container.activateComponent(as);
        as = new ActivationSpec();
        as.setId("xfireBinding");
        as.setComponent(new HttpSoapConnector(null, PORT, true));
        as.setDestinationService(new QName("echo"));
        container.activateComponent(as);
       
        URLConnection connection = new URL("http://localhost:" + PORT).openConnection();
        connection.setDoOutput(true);
        connection.setDoInput(true);
View Full Code Here


        logger.info(baos.toString());
    }

    public void testInOnly() throws Exception {
        int PORT = 7013;
        ActivationSpec as = new ActivationSpec();
        as.setId("trace");
        as.setComponent(new TraceComponent());
        as.setService(new QName("trace"));
        container.activateComponent(as);
        as = new ActivationSpec();
        as.setId("xfireBinding");
        as.setComponent(new HttpSoapConnector(null, PORT, false));
        as.setDestinationService(new QName("trace"));
        container.activateComponent(as);

        PostMethod method = new PostMethod("http://localhost:" + PORT + "/?name=Guillaume");
        method.setRequestEntity(new InputStreamRequestEntity(getClass().getResourceAsStream("soap-request.xml")));
        new HttpClient().executeMethod(method);
View Full Code Here

       
        logger.info(new SourceTransformer().toString(in.getContent()));
    }
   
    public void testMarshalerNamespaces() throws Exception {
        ActivationSpec as = new ActivationSpec();
        as.setId("mock");
        MockServiceComponent mock = new MockServiceComponent();
        mock.setResponseResource(new ClassPathResource("org/apache/servicemix/components/http/soap-response.xml"));
        as.setComponent(mock);
        as.setService(new QName("mock"));
        container.activateComponent(as);
       
        as = new ActivationSpec();
        as.setId("http");
        as.setDestinationService(new QName("mock"));
        HttpConnector http = new HttpConnector();
        http.setPort(8100);
        as.setComponent(http);
        container.activateComponent(as);

        String url = "http://localhost:8100";
        HttpSoapClientMarshaler marshaler = new HttpSoapClientMarshaler();
        PostMethod method = new PostMethod(url);
View Full Code Here

        assertEquals("http://www.w3.org/2001/XMLSchema", qname.getNamespaceURI());
        assertEquals("string", qname.getLocalPart());
    }
   
    public void testNamespaces() throws Exception {
        ActivationSpec as = new ActivationSpec();
        as.setId("receiver");
        ReceiverComponent receiver = new ReceiverComponent();
        as.setComponent(receiver);
        as.setService(new QName("receiver"));
        container.activateComponent(as);
       
        as = new ActivationSpec();
        as.setId("http");
        as.setDestinationService(new QName("receiver"));
        HttpSoapConnector http = new HttpSoapConnector();
        http.setDefaultInOut(false);
        http.setPort(8100);
        as.setComponent(http);
        container.activateComponent(as);

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

            container.shutDown();
        }
    }
   
    public void testWithAttachments() throws Exception {
        ActivationSpec as = new ActivationSpec();
        as.setId("echo");
        as.setComponent(new EchoComponent());
        as.setService(new QName("echo"));
        container.activateComponent(as);
        as = new ActivationSpec();
        as.setId("xfireBinding");
        as.setComponent(new HttpSoapConnector(null, PORT, true));
        as.setDestinationService(new QName("echo"));
        container.activateComponent(as);

        JavaMailAttachments sendAtts = new JavaMailAttachments();
        sendAtts.setSoapMessage(new SimpleAttachment("soap-request.xml",
                createDataHandler("soap-request.xml")));
View Full Code Here

    return new QName("http://www.neogrid.com.br", "component");
  }

  private void setUpSender() throws Exception {
    sender = new SenderComponent();
    ActivationSpec as = new ActivationSpec(SenderComponent.ENDPOINT, sender);
    as.setService(SenderComponent.SERVICE);
    as.setDestinationService(getComponentService());
    jbiContainer.activateComponent(as);
  }
View Full Code Here

    jbiContainer.activateComponent(as);
  }

  private void setUpReceiver() throws Exception {
    receiver = new ReceiverComponent();
    ActivationSpec as = new ActivationSpec(ReceiverComponent.ENDPOINT,
        receiver);
    as.setService(ReceiverComponent.SERVICE);
    jbiContainer.activateComponent(as);
  }
View Full Code Here

  }

  private void setUpComponent() throws Exception {
    fec = new SplitterComponent();
    fec.setNodePath("");
    ActivationSpec as = new ActivationSpec("component", fec);
    as.setService(getComponentService());
    as.setDestinationService(ReceiverComponent.SERVICE);
    jbiContainer.activateComponent(as);
  }
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);
                LOGGER.debug("default destination serviceName for {} = {}", componentName, serviceName);
            }
            QName interfaceName = activationSpec.getDestinationInterface();
            if (interfaceName != null) {
                result.setInterfaceName(interfaceName);
                LOGGER.debug("default destination interfaceName for {} = {}", componentName, interfaceName);
            }
            QName operationName = activationSpec.getDestinationOperation();
            if (operationName != null) {
                result.setOperationName(operationName);
                LOGGER.debug("default destination operationName for {} = {}", componentName, operationName);
            }
            String endpointName = activationSpec.getDestinationEndpoint();
            if (endpointName != null) {
                boolean endpointSet = false;
                LOGGER.debug("default destination endpointName for {} = {}", componentName, endpointName);
                if (serviceName != null && endpointName != null) {
                    endpointName = endpointName.trim();
View Full Code Here

            LOGGER.debug("Installation Descriptor Extension Not Found !");
        }
        // lets load this from Spring...
        Map map = applicationContext.getBeansOfType(ActivationSpec.class, false, false);
        for (Iterator iter = map.values().iterator(); iter.hasNext();) {
            ActivationSpec spec = (ActivationSpec) iter.next();
            LOGGER.debug("Registering {}", spec.getComponentName());
        }
    }
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.