Package org.menacheri.jetserver.event

Examples of org.menacheri.jetserver.event.EventDispatcher.addHandler()


  public void specificEventReceiptOnSpecificEventHandler()
      throws InterruptedException {
    EventDispatcher dispatcher = EventDispatchers
        .newJetlangEventDispatcher(null, null);
    final CountDownLatch latch = new CountDownLatch(1);
    dispatcher.addHandler(new EventHandler() {

      @Override
      public void onEvent(Event event) {
        latch.countDown();
      }
View Full Code Here


  @Test
  public void eventReceiptOnANYTypeEventHandler() throws InterruptedException {
    EventDispatcher dispatcher = EventDispatchers
        .newJetlangEventDispatcher(null, null);
    final CountDownLatch latch = new CountDownLatch(5);
    dispatcher.addHandler(new EventHandler() {

      @Override
      public void onEvent(Event event) {
        latch.countDown();
      }
View Full Code Here

  public void nonReceiptOfWrongEventOnSpecificEventHandler()
      throws InterruptedException {
    EventDispatcher dispatcher = EventDispatchers
        .newJetlangEventDispatcher(null, null);
    final CountDownLatch latch = new CountDownLatch(1);
    dispatcher.addHandler(new EventHandler() {

      @Override
      public void onEvent(Event event) {
        latch.countDown();
      }
View Full Code Here

  public void eventPublishingPerformance() throws InterruptedException {
    EventDispatcher dispatcher = EventDispatchers
        .newJetlangEventDispatcher(null, null);
    int countOfEvents = 5000000;
    final CountDownLatch latch = new CountDownLatch(countOfEvents);
    dispatcher.addHandler(new EventHandler() {

      @Override
      public void onEvent(Event event) {
        latch.countDown();
      }
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.