Package org.powertac.server
Class VisualizerProxyService
- java.lang.Object
-
- org.powertac.server.VisualizerProxyService
-
- All Implemented Interfaces:
InitializationService
,VisualizerProxy
@Service public class VisualizerProxyService extends Object implements VisualizerProxy, InitializationService
Connects the server with a Visualizer- Author:
- John Collins
-
-
Constructor Summary
Constructors Constructor Description VisualizerProxyService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
forwardMessage(Object message)
Forwards message to registered listenersString
getVisualizerQueueName()
String
initialize(Competition competition, List<String> completedInits)
Initializes a plugin prior to the beginning of a game.boolean
isActive()
True just in case a remote visualizer has pinged this servervoid
registerVisualizerMessageListener(VisualizerMessageListener listener)
Sets up a dispatch listener for market messagesvoid
respondToPing()
void
setRemoteVisualizer(boolean remoteVisualizer)
void
waitForRemoteViz(long maxDelay)
Waits at most maxDelay for a remote visualizer to check in with a ping.
-
-
-
Method Detail
-
setRemoteVisualizer
public void setRemoteVisualizer(boolean remoteVisualizer)
- Parameters:
remoteVisualizer
- the remoteVisualizer to set
-
getVisualizerQueueName
public String getVisualizerQueueName()
- Returns:
- the visualizerQueueName
-
registerVisualizerMessageListener
public void registerVisualizerMessageListener(VisualizerMessageListener listener)
Description copied from interface:VisualizerProxy
Sets up a dispatch listener for market messages- Specified by:
registerVisualizerMessageListener
in interfaceVisualizerProxy
-
forwardMessage
public void forwardMessage(Object message)
Description copied from interface:VisualizerProxy
Forwards message to registered listeners- Specified by:
forwardMessage
in interfaceVisualizerProxy
-
initialize
public String initialize(Competition competition, List<String> completedInits)
Description copied from interface:InitializationService
Initializes a plugin prior to the beginning of a game. The completedInits parameter is the list of plugin role names that have been successfully initialized. If sequence dependencies are satisfied (or if there are no sequence dependencies), then an implementation must complete its pre-game initialization process and return its role name. If sequence dependencies are not satisfied, then an implementation must return null. It will be called again after additional successful initializations have been completed. If initialization is not possible, then returning the string 'fail' will cause the server to log an error and shut down. This will be helpful just in case the implementation also logs a detailed error message.- Specified by:
initialize
in interfaceInitializationService
-
respondToPing
public void respondToPing()
-
isActive
public boolean isActive()
True just in case a remote visualizer has pinged this server
-
waitForRemoteViz
public void waitForRemoteViz(long maxDelay)
Waits at most maxDelay for a remote visualizer to check in with a ping.
-
-