Package org.menacheri.jetserver.event

Examples of org.menacheri.jetserver.event.EventHandler


   *            The session for which the event handlers are created.
   */
  protected void createAndAddEventHandlers(PlayerSession playerSession)
  {
    // Create a network event listener for the player session.
    EventHandler networkEventHandler = new NetworkEventListener(playerSession);
    // Add the handler to the game room's EventDispatcher so that it will
    // pass game room network events to player session session.
    this.eventDispatcher.addHandler(networkEventHandler);
    LOG.trace("Added Network handler to "
        + "EventDispatcher of GameRoom {}, for session: {}", this,
View Full Code Here


  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

Related Classes of org.menacheri.jetserver.event.EventHandler

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.