Package org.apache.wicket.protocol.ws

Examples of org.apache.wicket.protocol.ws.IWebSocketSettings


      @Override
      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


        String message = ajaxMessage.getModelObject();
        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

    @Override
    public void run()
    {
      Application application = Application.get(applicationName);
      IWebSocketSettings webSocketSettings = IWebSocketSettings.Holder.get(application);
      IWebSocketConnectionRegistry webSocketConnectionRegistry = webSocketSettings.getConnectionRegistry();
      IWebSocketConnection connection = webSocketConnectionRegistry.getConnection(application, sessionId, key);

      int dataIndex = 0;

      while (dataIndex < data.length)
View Full Code Here

   * @param message
   *          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

   * @param message
   *          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

    WicketFilter wicketFilter = application.getWicketFilter();
    this.webRequest = new WebSocketRequest(new ServletRequestCopy(request), getFilterPath(wicketFilter));

    this.application = Args.notNull(application, "application");
    IWebSocketSettings webSocketSettings = IWebSocketSettings.Holder.get(application);
    this.connectionRegistry = webSocketSettings.getConnectionRegistry();
  }
View Full Code Here

          }
        }
      }
    };

    IWebSocketSettings webSocketSettings = IWebSocketSettings.Holder.get(application);
    if (webSocketSettings instanceof WebSocketSettings)
    {
      WebSocketSettings wss = (WebSocketSettings) webSocketSettings;
      wss.getSendPayloadExecutor().run(action);
    }
View Full Code Here

  }

  private void process(final Application application, final Collection<IWebSocketConnection> wsConnections,
                       final IWebSocketPushMessage message)
  {
    IWebSocketSettings webSocketSettings = IWebSocketSettings.Holder.get(application);
    Executor executor = webSocketSettings.getWebSocketPushMessageExecutor();
    for (final IWebSocketConnection wsConnection : wsConnections)
    {
      executor.run(new Runnable()
      {
        @Override
View Full Code Here

    WicketFilter wicketFilter = application.getWicketFilter();
    this.webRequest = new WebSocketRequest(new ServletRequestCopy(request), getFilterPath(wicketFilter));

    this.application = Args.notNull(application, "application");
    IWebSocketSettings webSocketSettings = IWebSocketSettings.Holder.get(application);
    this.connectionRegistry = webSocketSettings.getConnectionRegistry();
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.protocol.ws.IWebSocketSettings

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.