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

Examples of org.apache.wicket.protocol.ws.api.WebSocketPushBroadcaster


      protected void onMessage(WebSocketRequestHandler handler, TextMessage message)
      {
        log.info("Received message {}", message.getText());
        FeedItem feedItem = new FeedItem(message.getText());
        IWebSocketSettings webSocketSettings = IWebSocketSettings.Holder.get(getApplication());
        WebSocketPushBroadcaster broadcaster =
            new WebSocketPushBroadcaster(webSocketSettings.getConnectionRegistry());
        broadcaster.broadcastAll(Application.get(), feedItem);
        latestMessage.setDefaultModelObject(feedItem).modelChanged();
        log.info("AddContent: {}", handler);
        handler.add(latestMessage);
      }
View Full Code Here


        final FeedItem feedItem = new FeedItem(message);
        latestMessage.setDefaultModelObject(feedItem);
        ajaxMessage.setModelObject(null);
        target.add(ajaxForm);
        IWebSocketSettings webSocketSettings = IWebSocketSettings.Holder.get(getApplication());
        WebSocketPushBroadcaster broadcaster =
            new WebSocketPushBroadcaster(webSocketSettings.getConnectionRegistry());
        broadcaster.broadcastAll(Application.get(), feedItem);
      }
    });

  };
View Full Code Here

  public void run()
  {
    log.info("Sending timestamp to feed");
    FeedItem feedItem = new FeedItem("------ TIMESTAMP --------");
    IWebSocketSettings webSocketSettings = IWebSocketSettings.Holder.get(application);
    WebSocketPushBroadcaster broadcaster =
        new WebSocketPushBroadcaster(webSocketSettings.getConnectionRegistry());
    broadcaster.broadcastAll(application, feedItem);
  }
View Full Code Here

   *          The message to broadcast/push
   */
  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);
  }
View Full Code Here

   *          The message to broadcast/push
   */
  public void broadcastAll(Application application, IWebSocketPushMessage message)
  {
    IWebSocketSettings webSocketSettings = IWebSocketSettings.Holder.get(application);
    WebSocketPushBroadcaster broadcaster = new WebSocketPushBroadcaster(webSocketSettings.getConnectionRegistry());
    broadcaster.broadcastAll(application, message);
  }
View Full Code Here

   *          The message to broadcast/push
   */
  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);
  }
View Full Code Here

   *          The message to broadcast/push
   */
  public void broadcastAll(Application application, IWebSocketPushMessage message)
  {
    WebSocketSettings webSocketSettings = WebSocketSettings.Holder.get(application);
    WebSocketPushBroadcaster broadcaster = new WebSocketPushBroadcaster(webSocketSettings.getConnectionRegistry());
    broadcaster.broadcastAll(application, message);
  }
View Full Code Here

    tester.startPage(page);
    tester.getSession().bind();

    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());
  }
View Full Code Here

    tester.startPage(page);
    tester.getSession().bind();

    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());
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.protocol.ws.api.WebSocketPushBroadcaster

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.