Class GameManager
java.lang.Object
net.sf.colossus.webserver.GameManager
- All Implemented Interfaces:
Remote, IGameManager
This "manager" is accessible via RMI (served by the ColossusRegistry
object) for the games started in own processes.
Once a game comes up, it can register to here, telling it's game Id,
and reporting anything that happens which is of interest to the server;
for example, this could be things like player died etc.
Additionally the server can communicate with the games, because it
gets their game Id, and looks up the ManagedGame remote object for it.
TODO: work just started (2011-04-24)
- Author:
- Clemens Katzer
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate static voidintprivate voidvoidprivate IManagedGamelookupGameByRegid(String gameId) static voidThis is only for testing purposes.voidregisterGame(String gameId) private voidprivate static voidsleepFor(long millis) voidvoidunregisterGame(String gameId) void
-
Field Details
-
LOGGER
-
OBJ_ID
- See Also:
-
games
-
r
-
registry
-
-
Constructor Details
-
GameManager
public GameManager()
-
-
Method Details
-
initRegistryIfNeeded
private void initRegistryIfNeeded() -
doGetRegistry
private void doGetRegistry() -
listRegistryContents
public void listRegistryContents() -
registerManager
private void registerManager() -
unregisterManager
public void unregisterManager() -
getGameCount
public int getGameCount() -
tellEvent
- Specified by:
tellEventin interfaceIGameManager- Throws:
RemoteException
-
registerGame
- Specified by:
registerGamein interfaceIGameManager- Throws:
RemoteExceptionNotBoundException
-
unregisterGame
public void unregisterGame(String gameId) throws AccessException, NotBoundException, RemoteException - Specified by:
unregisterGamein interfaceIGameManager- Throws:
AccessExceptionNotBoundExceptionRemoteException
-
lookupGameByRegid
private IManagedGame lookupGameByRegid(String gameId) throws AccessException, NotBoundException, RemoteException -
main
This is only for testing purposes. Normally the GameManager object is created by WebServer object. -
sleepFor
private static void sleepFor(long millis) -
exitOnReturn
-