Package com.wicketinaction

Source Code of com.wicketinaction.TimestamperTask

package com.wicketinaction;

import org.apache.wicket.Application;
import org.apache.wicket.protocol.ws.IWebSocketSettings;
import org.apache.wicket.protocol.ws.api.WebSocketPushBroadcaster;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TimestamperTask implements Runnable
{
  private static final Logger log = LoggerFactory.getLogger(TimestamperTask.class);

  private final Application application;
 
  public TimestamperTask(Application application)
  {
    this.application = application;
  }

  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);
  }
}
TOP

Related Classes of com.wicketinaction.TimestamperTask

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.