Examples of ListenerRegistration


Examples of javax.management.j2ee.ListenerRegistration

         {
            fail("Could not found JSR-77 JavaMailResource'" + TEST_MAIL + "'");
         }
         ObjectName lMail = (ObjectName) names.iterator().next();
         Listener lLocalListener = new Listener();
         ListenerRegistration lListenerFactory = jsr77MEJB.getListenerRegistry();
         getLog().debug("+++ testNotificationDeliver, add Notification Listener to " + TEST_MAIL +
            " with Listener Registry: " + lListenerFactory);
         lListenerFactory.addNotificationListener(
            lMail,
            lLocalListener,
            null,
            null
         );
         getLog().debug("+++ testNotificationDeliver, stop " + TEST_MAIL + "");
         jsr77MEJB.invoke(lMail, "stop", new Object[]{}, new String[]{});
         getLog().debug("+++ testNotificationDeliver, start " + TEST_MAIL + "");
         jsr77MEJB.invoke(lMail, "start", new Object[]{}, new String[]{});
         // Wait 5 seconds to ensure that the notifications are delivered
         Thread.sleep(5000);
         if (lLocalListener.getNumberOfNotifications() < 2)
         {
            fail("Not enough notifications received: " + lLocalListener.getNumberOfNotifications());
         }
         getLog().debug("+++ testNotificationDeliver, remove Notification Listener from " + TEST_MAIL + "");
         lListenerFactory.removeNotificationListener(
            lMail,
            lLocalListener
         );
         jsr77MEJB.remove();
      }
View Full Code Here

Examples of org.infinispan.affinity.ListenerRegistration

      } finally {
         maxNumberInvariant.writeLock().unlock();
      }
      keyGenWorker = new KeyGeneratorWorker();
      executor.execute(keyGenWorker);
      listenerRegistration = new ListenerRegistration(this);
      cache.getCacheManager().addListener(listenerRegistration);
      cache.addListener(listenerRegistration);
      keyProducerStartLatch.open();
      started = true;
   }
View Full Code Here

Examples of org.jboss.errai.otec.client.ListenerRegistration

            }.schedule(1);
          }
        }
    );

    final ListenerRegistration listenerRegistration
        = entity.getState().addStateChangeListener(new StateChangeListener() {
      @Override
      public int getCursorPos() {
        return widget.getCursorPos();
      }

      @Override
      public void onStateChange(final int newCursorPos, final Object newValue) {
        if (NO_PROPAGATE_STATE_CHANGE) {
          return;
        }

        widget.setValue(newValue, false);
        widget.setCursorPos(newCursorPos);
      }
    });

    DOM.sinkEvents(widget.getElement(), DOM.getEventsSunk(widget.getElement()) | Event.ONPASTE);

    final Timer timer = new Timer() {
      @Override
      public void run() {
        entityChangeStream.flush();
      }
    };
    timer.scheduleRepeating(500);

    return new AtomizerSession() {
      @Override
      public void end() {
        entityChangeStream.close();
        timer.cancel();

        logger.info("END ATOMIZER SESSION");
        entityStreamRegistration.remove();
        listenerRegistration.remove();
        final Collection<HandlerRegistration> values = HANDLER_REGISTRATION_MAP.values();
        for (final HandlerRegistration value : values) {
          value.removeHandler();
        }
      }
View Full Code Here

Examples of org.jboss.errai.otec.client.ListenerRegistration

            }.schedule(1);
          }
        }
    );

    final ListenerRegistration listenerRegistration
        = entity.getState().addStateChangeListener(new StateChangeListener() {
      @Override
      public int getCursorPos() {
        return widget.getCursorPos();
      }

      @Override
      public void onStateChange(final int newCursorPos, final Object newValue) {
        if (NO_PROPAGATE_STATE_CHANGE) {
          return;
        }

        widget.setValue(newValue, false);
        widget.setCursorPos(newCursorPos);
      }
    });

    DOM.sinkEvents(widget.getElement(), DOM.getEventsSunk(widget.getElement()) | Event.ONPASTE);

    final Timer timer = new Timer() {
      @Override
      public void run() {
        entityChangeStream.flush();
      }
    };
    timer.scheduleRepeating(500);

    return new AtomizerSession() {
      @Override
      public void end() {
        entityChangeStream.close();
        timer.cancel();

        LogUtil.log("END ATOMIZER SESSION");
        entityStreamRegistration.remove();
        listenerRegistration.remove();
        final Collection<HandlerRegistration> values = HANDLER_REGISTRATION_MAP.values();
        for (final HandlerRegistration value : values) {
          value.removeHandler();
        }
      }
View Full Code Here

Examples of org.jboss.mx.notification.ListenerRegistration

   public void sendNotification(Notification notification)
   {
      ListenerRegistry.ListenerRegistrationIterator iterator = registry.iterator();
      while (iterator.hasNext())
      {
         ListenerRegistration registration = iterator.nextRegistration();
         NotificationFilter filter = registration.getFilter();
         if (filter == null)
            handleNotification(registration.getListener(), notification, registration.getHandback());
         else if (filter.isNotificationEnabled(notification))
            handleNotification(registration.getListener(), notification, registration.getHandback());
      }
   }
View Full Code Here

Examples of org.jboss.mx.notification.ListenerRegistration

   public void sendNotification(Notification notification)
   {
      ListenerRegistry.ListenerRegistrationIterator iterator = registry.iterator();
      while(iterator.hasNext())
      {
         ListenerRegistration registration = iterator.nextRegistration();
         NotificationFilter filter = registration.getFilter();
         if(filter == null)
         {
            handleNotification(registration.getListener(), notification, registration.getHandback());
         }
         else if(filter.isNotificationEnabled(notification))
         {
            handleNotification(registration.getListener(), notification, registration.getHandback());
         }
      }
   }
View Full Code Here

Examples of org.jboss.mx.notification.ListenerRegistration

/*     */   public void sendNotification(Notification notification)
/*     */   {
/* 102 */     ListenerRegistry.ListenerRegistrationIterator iterator = this.registry.iterator();
/* 103 */     while (iterator.hasNext())
/*     */     {
/* 105 */       ListenerRegistration registration = iterator.nextRegistration();
/* 106 */       NotificationFilter filter = registration.getFilter();
/* 107 */       if (filter == null)
/* 108 */         handleNotification(registration.getListener(), notification, registration.getHandback());
/* 109 */       else if (filter.isNotificationEnabled(notification))
/* 110 */         handleNotification(registration.getListener(), notification, registration.getHandback());
/*     */     }
/*     */   }
View Full Code Here

Examples of org.jboss.mx.notification.ListenerRegistration

   public void sendNotification(Notification notification)
   {
      ListenerRegistry.ListenerRegistrationIterator iterator = registry.iterator();
      while (iterator.hasNext())
      {
         ListenerRegistration registration = iterator.nextRegistration();
         NotificationFilter filter = registration.getFilter();
         if (filter == null)
            handleNotification(registration.getListener(), notification, registration.getHandback());
         else if (filter.isNotificationEnabled(notification))
            handleNotification(registration.getListener(), notification, registration.getHandback());
      }
   }
View Full Code Here

Examples of org.jboss.mx.notification.ListenerRegistration

   public void sendNotification(Notification notification)
   {
      ListenerRegistry.ListenerRegistrationIterator iterator = registry.iterator();
      while (iterator.hasNext())
      {
         ListenerRegistration registration = iterator.nextRegistration();
         NotificationFilter filter = registration.getFilter();
         if (filter == null)
            handleNotification(registration.getListener(), notification, registration.getHandback());
         else if (filter.isNotificationEnabled(notification))
            handleNotification(registration.getListener(), notification, registration.getHandback());
      }
   }
View Full Code Here

Examples of org.waveprotocol.wave.model.document.util.ListenerRegistration

  @SuppressWarnings("unchecked")
  public void testAddedOnDemand() {
    assertEquals(0, docListeners.size());
    DocumentEventRouter<Doc.N, Doc.E, ?> router = createRouter(doc);
    assertEquals(0, docListeners.size());
    ListenerRegistration firstReg = router.addAttributeListener(new DummyElm(),
        mock(AttributeListener.class));
    assertEquals(1, docListeners.size());
    ListenerRegistration secondReg = router.addAttributeListener(new DummyElm(),
        mock(AttributeListener.class));
    assertEquals(1, docListeners.size());
    firstReg.detach();
    assertEquals(1, docListeners.size());
    secondReg.detach();
    assertEquals(0, docListeners.size());
  }
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.