Package org.servicemix.jbi.container

Examples of org.servicemix.jbi.container.ActivationSpec


      //container.setCreateMBeanServer(true);
      container.init();
      container.start();
     
      Sender sender = new SenderComponent();
            ActivationSpec senderActivationSpec = new ActivationSpec("sender", sender);
            senderActivationSpec.setFailIfNoDestinationEndpoint(false);
            container.activateComponent(senderActivationSpec);
     
      ReceiverListener receiver1 = new ReceiverListener();
      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

    public void testParse() throws Exception {
        List activationSpecs = Arrays.asList(jbi.getActivationSpecs());
        assertEquals("Size of activation specs: " + activationSpecs, 1, activationSpecs.size());

        ActivationSpec activationSpec = (ActivationSpec) activationSpecs.get(0);
        SubscriptionSpec[] subscriptions = activationSpec.getSubscriptions();
        assertEquals("Size of subscriptions", 1, subscriptions.length);

        SubscriptionSpec subscription = subscriptions[0];

        QName producer = new QName(NAMESPACE, "producer");
View Full Code Here

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

        container.activateComponent(new ActivationSpec("sender", sender));
        container.activateComponent(new ActivationSpec("receiver", receiver));
    }
View Full Code Here

          receiver = new ReceiverComponent();
        } else {
          receiver = new AsyncReceiverPojo();
        }

        senderContainer.activateComponent(new ActivationSpec("sender", sender));
        senderContainer.activateComponent(new ActivationSpec("receiver", receiver));
       
        tt.execute(new TransactionCallback() {
        public Object doInTransaction(TransactionStatus status) {
                try {
                    sender.sendMessages(NUM_MESSAGES, syncSend);
View Full Code Here

          receiver = new ReceiverComponent();
        } else {
          receiver = new AsyncReceiverPojo();
        }

        senderContainer.activateComponent(new ActivationSpec("sender", sender));
        receiverContainer.activateComponent(new ActivationSpec("receiver", receiver));
        Thread.sleep(1000);
       
        tt.execute(new TransactionCallback() {
        public Object doInTransaction(TransactionStatus status) {
                try {
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));

        assertTrue("Sender cluster complete",senderFlow.waitForClusterToComplete(1, 10000));
        assertTrue("Receiver cluster complete",receiverFlow.waitForClusterToComplete(1,10000));
    }
View Full Code Here

    public void testInOnly() throws Exception {
        final SenderComponent sender = new SenderComponent();
        final ReceiverComponent receiver =  new ReceiverComponent();
        sender.setResolver(new ServiceNameEndpointResolver(ReceiverComponent.SERVICE));

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

        Thread.sleep(5000);

        sender.sendMessages(NUM_MESSAGES);
        Thread.sleep(3000);
View Full Code Here

    public void testTxInOnly() throws Exception {
        final SenderComponent sender = new SenderComponent();
        final ReceiverComponent receiver =  new ReceiverComponent();
        sender.setResolver(new ServiceNameEndpointResolver(ReceiverComponent.SERVICE));

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

        Thread.sleep(5000);
       
      senderContainer.setAutoEnlistInTransaction(true);
        tt.execute(new TransactionCallback() {
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

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.