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

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


        // Pause the subscription.
        broker.getSubscriptionManager().pauseSubscription(subRef);

        // The sub should be stopped and we should not be getting notifed now.
        sendNotification(broker);
        subNotifyDoc = (List<NotificationMessageHolderType>) result.poll(2000);
        assertNull(subNotifyDoc);

        // Resume the subscription.
        broker.getSubscriptionManager().resumeSubscription(subRef);
View Full Code Here


        // Resume the subscription.
        broker.getSubscriptionManager().resumeSubscription(subRef);

        // We should now get the message that was previously sent since the sub
        // is now running.
        subNotifyDoc = (List<NotificationMessageHolderType>) result.poll(2000);
        assertNotNull(subNotifyDoc);
    }

    protected ActiveMQNotificationBroker createBroker(final Slot result) throws JMSException {
        ActiveMQNotificationBroker broker = new ActiveMQNotificationBroker() {
View Full Code Here

      }, "Closer").start();

      log.info("attempting to close for 5 secs ...");

      // valve cannot be closed at this time
      Object o = slot.poll(5000);
      assertNull(o);

      // exit the valve
      valve.leave();
      o = slot.take();
View Full Code Here

      }, "Closer").start();

      log.info("attempting to close ...");

      // valve cannot be closed at this time
      Object o = slot.poll(5000);
      assertNotNull(o);
      assertEquals("CLOSED", o);
   }

View Full Code Here

      }, "LoneCloser").start();


      Thread.sleep(5000);
      log.info("valve should be closed by now ...");
      Object o = loneSlot.poll(3000);
      assertNotNull(o);
      assertEquals("CLOSED", o);

      for(int i = 0; i < THREAD_COUNT; i++)
      {
View Full Code Here

        producer.send(session.createTextMessage("test"));
        System.out.println("Message sent");
        connection.close();
       
        // Assert the message got there:
        assertNotNull(messageSlot.poll(1000*5));       
       
    }

}
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

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.