Package org.apache.wicket.protocol.ws.api

Examples of org.apache.wicket.protocol.ws.api.WebSocketPushBroadcaster.broadcast()


  public void broadcast(Application application, String sessionId, IKey key, IWebSocketPushMessage message)
  {
    IWebSocketSettings webSocketSettings = IWebSocketSettings.Holder.get(application);
    WebSocketPushBroadcaster broadcaster = new WebSocketPushBroadcaster(webSocketSettings.getConnectionRegistry());
    ConnectedMessage wsMessage = new ConnectedMessage(application, sessionId, key);
    broadcaster.broadcast(wsMessage, message);
  }

  /**
   * Broadcasts/pushes a message to all active web socket connections
   *
 
View Full Code Here


  public void broadcast(Application application, String sessionId, IKey key, IWebSocketPushMessage message)
  {
    WebSocketSettings webSocketSettings = WebSocketSettings.Holder.get(application);
    WebSocketPushBroadcaster broadcaster = new WebSocketPushBroadcaster(webSocketSettings.getConnectionRegistry());
    ConnectedMessage wsMessage = new ConnectedMessage(application, sessionId, key);
    broadcaster.broadcast(wsMessage, message);
  }

  /**
   * Broadcasts/pushes a message to all active web socket connections
   *
 
View Full Code Here

    new WebSocketTester(tester, page);
    IWebSocketSettings webSocketSettings = IWebSocketSettings.Holder.get(tester.getApplication());
    WebSocketPushBroadcaster broadcaster = new WebSocketPushBroadcaster(webSocketSettings.getConnectionRegistry());
    ConnectedMessage wsMessage = new ConnectedMessage(tester.getApplication(),
        tester.getHttpSession().getId(), page.getPageId());
    broadcaster.broadcast(wsMessage, new BroadcastMessage(message));

    assertEquals(true, messageReceived.get());
  }

  private static class BroadcastMessage implements IWebSocketPushMessage
View Full Code Here

    new WebSocketTester(tester, page);
    IWebSocketSettings webSocketSettings = IWebSocketSettings.Holder.get(tester.getApplication());
    WebSocketPushBroadcaster broadcaster = new WebSocketPushBroadcaster(webSocketSettings.getConnectionRegistry());
    ConnectedMessage wsMessage = new ConnectedMessage(tester.getApplication(),
        tester.getHttpSession().getId(), new PageIdKey(page.getPageId()));
    broadcaster.broadcast(wsMessage, new BroadcastMessage(message));

    assertEquals(true, messageReceived.get());
  }

  private static class BroadcastMessage implements IWebSocketPushMessage
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.