Package org.powertac.server
Class MessageRouter
- java.lang.Object
-
- org.powertac.server.MessageRouter
-
- All Implemented Interfaces:
InitializationService
@Service public class MessageRouter extends Object implements InitializationService
-
-
Constructor Summary
Constructors Constructor Description MessageRouter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<Object>
getRegistrations(Object message)
returns the registrations for the given messageString
initialize(Competition competition, List<String> completedInits)
Initializes a plugin prior to the beginning of a game.void
recycle()
Initializes the message listener registrations at the pre-game phase, once per game.void
registerBrokerMessageListener(Object listener, Class<?> clazz)
boolean
route(Object message)
-
-
-
Method Detail
-
getRegistrations
public Set<Object> getRegistrations(Object message)
returns the registrations for the given message
-
registerBrokerMessageListener
public void registerBrokerMessageListener(Object listener, Class<?> clazz)
-
recycle
public void recycle()
Initializes the message listener registrations at the pre-game phase, once per game.
-
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
-
route
public boolean route(Object message)
-
-