Package org.servicemix.jbi.container

Examples of org.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

    /**
     * Provides the JBI container used for message dispatch.
     */
    public DefaultServiceMixClient(JBIContainer container) throws JBIException {
        this(container, new ActivationSpec());
    }
View Full Code Here

    public void testXBeanJbi() throws Exception {
        URL url = Thread.currentThread().getContextClassLoader().getResource("addNumbers/xbean.xml");
        File path = new File(url.toURI());
        path = path.getParentFile();
        JAXWSComponent component = new JAXWSComponent();
        container.activateComponent(new ActivationSpec("jaxws", component));
        component.getServiceUnitManager().deploy("addNumbers", path.getAbsolutePath());
        component.start("addNumbers");

        SourceTransformer transformer = new SourceTransformer();
        QName serviceName = new QName("http://jaxws.components.servicemix.org/", "AddNumbersImplService");
View Full Code Here

      //container.setCreateMBeanServer(true);
      container.init();
      container.start();
     
      SenderListener sender = new SenderListener();
            ActivationSpec senderActivationSpec = new ActivationSpec("sender", sender);
            senderActivationSpec.setFailIfNoDestinationEndpoint(false);
      container.activateComponent(senderActivationSpec);
     
      Receiver receiver1 = new ReceiverComponent();
      container.activateComponent(createReceiverAS("receiver1", receiver1));
 
View Full Code Here

      container.shutDown();
    }
  }
 
  private ActivationSpec createReceiverAS(String id, Object component) {
    ActivationSpec as = new ActivationSpec(id, component);
    SubscriptionSpec ss = new SubscriptionSpec();
    ss.setService(SenderComponent.SERVICE);
    as.setSubscriptions(new SubscriptionSpec[] { ss });
    return as;
  }
View Full Code Here

       
        receiver = new ReceiverComponent();
        sender = new SenderComponent();
        sender.setResolver(new ServiceNameEndpointResolver(ReceiverComponent.SERVICE));

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

       
        Thread.sleep(2000);
    }
View Full Code Here

        final SenderComponent sender = new SenderComponent();
        final ReceiverComponent receiver1 =  new ReceiverComponent();
        final ReceiverComponent receiver2 =  new ReceiverComponent();
        sender.setResolver(new ServiceNameEndpointResolver(ReceiverComponent.SERVICE));

        senderContainer.activateComponent(new ActivationSpec("sender", sender));
        senderContainer.activateComponent(new ActivationSpec("receiver", receiver1));
        receiverContainer.activateComponent(new ActivationSpec("receiver", receiver2));
        Thread.sleep(1000);

        sender.sendMessages(NUM_MESSAGES);
        Thread.sleep(3000);
        assertTrue(receiver1.getMessageList().hasReceivedMessage());
        assertTrue(receiver2.getMessageList().hasReceivedMessage());
        receiver1.getMessageList().flushMessages();
        receiver2.getMessageList().flushMessages();
       
        senderContainer.deactivateComponent("receiver");
        Thread.sleep(1000);
       
        sender.sendMessages(NUM_MESSAGES);
        Thread.sleep(3000);
        assertFalse(receiver1.getMessageList().hasReceivedMessage());
        assertTrue(receiver2.getMessageList().hasReceivedMessage());
        receiver1.getMessageList().flushMessages();
        receiver2.getMessageList().flushMessages();
       
        senderContainer.activateComponent(new ActivationSpec("receiver", receiver1));
        receiverContainer.deactivateComponent("receiver");
        Thread.sleep(1000);
       
        sender.sendMessages(NUM_MESSAGES);
        Thread.sleep(3000);
View Full Code Here

            protected void process(MessageExchange exchange, NormalizedMessage message) throws MessagingException {
                System.out.println("Received: " + message);
                exchange.setStatus(ExchangeStatus.DONE);
            }
        };
        ActivationSpec as = new ActivationSpec("out",out);
        as.setService(new QName("out"));
        container.activateComponent(as);
        client = new DefaultServiceMixClient(container);
    }
View Full Code Here

                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
        };
        container.activateComponent(new ActivationSpec("receiver", receiver));
        ServiceMixClient client = new DefaultServiceMixClient(container);
        ServiceEndpoint[] endpoints = client.getContext().getExternalEndpoints(null);
        assertNotNull(endpoints);
        assertEquals(1, endpoints.length);
        assertNull(client.getContext().getEndpointDescriptor(endpoints[0]));
View Full Code Here

TOP

Related Classes of org.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.