Package org.apache.servicemix.jbi.container

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


     * @param exchange
     * @return the EndpointChooser
     */
    protected EndpointChooser getServiceChooser(MessageExchangeImpl exchange) {
        EndpointChooser chooser = null;
        ActivationSpec activationSpec = exchange.getActivationSpec();
        if (activationSpec != null) {
            chooser = activationSpec.getServiceChooser();
        }
        if (chooser == null) {
            chooser = defaultServiceChooser;
        }
        return chooser;
View Full Code Here


     * @param exchange
     * @return the EndpointChooser
     */
    protected EndpointChooser getInterfaceChooser(MessageExchangeImpl exchange) {
        EndpointChooser chooser = null;
        ActivationSpec activationSpec = exchange.getActivationSpec();
        if (activationSpec != null) {
            chooser = activationSpec.getInterfaceChooser();
        }
        if (chooser == null) {
            chooser = defaultInterfaceChooser;
        }
        return chooser;
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

            jbi.shutDown();
        }
    }
   
    protected void registerCreditAgency() throws Exception {
        ActivationSpec creditAgency = new ActivationSpec();
        creditAgency.setInterfaceName(new QName("urn:logicblaze:soa:creditagency", "CreditAgency"));
        creditAgency.setComponent(new CreditAgency());
        jbi.activateComponent(creditAgency);
    }
View Full Code Here

        jbi.activateComponent(creditAgency);
    }
   
    protected void registerBanks() throws Exception {
        for (int i = 1; i <= 5; i++) {
            ActivationSpec bank = new ActivationSpec();
            bank.setInterfaceName(new QName("urn:logicblaze:soa:bank", "Bank"));
            bank.setComponent(new Bank(i));
            jbi.activateComponent(bank);
        }
    }
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);
    }
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

        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

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

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

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

    // Start container
    container.start();
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.