Package net.sf.colossus.webserver
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 void
private static void
int
private void
void
private IManagedGame
lookupGameByRegid
(String gameId) static void
This is only for testing purposes.void
registerGame
(String gameId) private void
private static void
sleepFor
(long millis) void
void
unregisterGame
(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:
tellEvent
in interfaceIGameManager
- Throws:
RemoteException
-
registerGame
- Specified by:
registerGame
in interfaceIGameManager
- Throws:
RemoteException
NotBoundException
-
unregisterGame
public void unregisterGame(String gameId) throws AccessException, NotBoundException, RemoteException - Specified by:
unregisterGame
in interfaceIGameManager
- Throws:
AccessException
NotBoundException
RemoteException
-
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
-