Package EDU.oswego.cs.dl.util.concurrent

Examples of EDU.oswego.cs.dl.util.concurrent.Slot.poll()


      MessageProducer prod = session2.createProducer(topic);
      Message m = session.createTextMessage("blah");

      prod.send(m);

      TextMessage rm = (TextMessage)slot.poll(5000);

      assertEquals("blah", rm.getText());

      // Only for JBoss Remoting > 2.0.0.Beta1
      long sleepTime = ServerInvoker.DEFAULT_TIMEOUT_PERIOD + 60000;
View Full Code Here


      // this message to the MessageCallbackHandler, and the test will fail

      Message m2 = session.createTextMessage("blah2");
      prod.send(m2);

      TextMessage rm2 = (TextMessage)slot.poll(5000);

      assertNotNull(rm2);
      assertEquals("blah2", rm2.getText());

      conn.close();
View Full Code Here

      TextMessage m = session.createTextMessage("message one");

      prod.send(m);

      TextMessage rm = (TextMessage)slot.poll(5000);

      assertEquals("message one", rm.getText());

      conn.close();
   }
View Full Code Here

      MessageProducer prod = session.createProducer(queue);
      prod.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
      TextMessage m = session.createTextMessage("one");
      prod.send(m);

      TextMessage rm = (TextMessage)slot.poll(5000);

      assertEquals("one", rm.getText());

      conn.close();
   }
View Full Code Here

        };

        addSubscription(broker);
        sendNotification(broker);

        NotifyDocument subNotifyDoc = (NotifyDocument) result.poll(2000);
        System.out.println("Got Notify: "+subNotifyDoc);

        assertValidMessage(subNotifyDoc);
    }
View Full Code Here

        EndpointReferenceType subRef = addSubscription(broker);
       
        // The sub should be running and we should be getting notifed now.
        sendNotification(broker);
        NotifyDocument subNotifyDoc = (NotifyDocument) result.poll(2000);
        assertNotNull(subNotifyDoc);
       
        // Pause the subscription.
        PauseSubscriptionDocument pauseRequest = PauseSubscriptionDocument.Factory.newInstance();
        pauseRequest.addNewPauseSubscription();
View Full Code Here

        pauseRequest.addNewPauseSubscription();
        broker.getSubscriptionManager().pauseSubcription(pauseRequest, subRef);       
       
        // The sub should be stopped and we should not be getting notifed now.
        sendNotification(broker);
        subNotifyDoc = (NotifyDocument) result.poll(2000);
        assertNull(subNotifyDoc);
       
        // Resume the subscription.
        ResumeSubscriptionDocument resumeRequest = ResumeSubscriptionDocument.Factory.newInstance();
        resumeRequest.addNewResumeSubscription();
View Full Code Here

        ResumeSubscriptionDocument resumeRequest = ResumeSubscriptionDocument.Factory.newInstance();
        resumeRequest.addNewResumeSubscription();
        broker.getSubscriptionManager().resumeSubscription(resumeRequest, subRef);       
       
        // We should now get the message that was previously sent since the sub is now running.
        subNotifyDoc = (NotifyDocument) result.poll(2000);
        assertNotNull(subNotifyDoc);
    }
}
View Full Code Here

        ActiveMQNotificationBroker broker = createBroker(result);

        addSubscription(broker);
        sendNotification(broker);

        List<NotificationMessageHolderType> notifyMessages = (List<NotificationMessageHolderType>) result.poll(2000);
        System.out.println("Got Notify: " + notifyMessages);

        assertValidMessage(notifyMessages);
    }
View Full Code Here

        EndpointReferenceType subRef = addSubscription(broker);

        // The sub should be running and we should be getting notifed now.
        sendNotification(broker);

        List<NotificationMessageHolderType> subNotifyDoc = (List<NotificationMessageHolderType>) result.poll(2000);
        assertNotNull(subNotifyDoc);

        // Pause the subscription.
        broker.getSubscriptionManager().pauseSubscription(subRef);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.