net.sf.colossus.server
Class ManagedGame
java.lang.Object
net.sf.colossus.server.ManagedGame
- All Implemented Interfaces:
- java.rmi.Remote, IManagedGame
public class ManagedGame
- extends java.lang.Object
- implements IManagedGame
Field Summary |
private boolean |
bound
True if registration to registry was successful |
private IGameManager |
gm
|
private java.lang.String |
id
|
private static java.util.logging.Logger |
LOGGER
|
private java.rmi.registry.Registry |
registry
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOGGER
private static final java.util.logging.Logger LOGGER
id
private final java.lang.String id
registry
private java.rmi.registry.Registry registry
gm
private IGameManager gm
bound
private boolean bound
- True if registration to registry was successful
ManagedGame
public ManagedGame(java.lang.String id)
throws java.rmi.RemoteException
- Throws:
java.rmi.RemoteException
tellStatus
public java.lang.String tellStatus()
throws java.rmi.RemoteException
- Specified by:
tellStatus
in interface IManagedGame
- Throws:
java.rmi.RemoteException
getRegistryId
public java.lang.String getRegistryId()
initRegistry
private void initRegistry()
throws java.rmi.RemoteException
- Throws:
java.rmi.RemoteException
getBound
public boolean getBound()
registerToRegistry
java.lang.Exception registerToRegistry()
- Register this managed game to rmi registry so that GameManager can
can find it from there via it's game id.
- Returns:
- An exception indicating a failure, null if all is ok.
unregisterFromRegistry
void unregisterFromRegistry()
throws java.rmi.AccessException,
java.rmi.NotBoundException,
java.rmi.RemoteException
- Throws:
java.rmi.AccessException
java.rmi.NotBoundException
java.rmi.RemoteException
registerToGameManager
void registerToGameManager()
throws java.rmi.AccessException,
java.rmi.NotBoundException,
java.rmi.RemoteException
- Register with own GameId-based RegistryId to the GameManager.
- Throws:
java.rmi.AccessException
java.rmi.NotBoundException
java.rmi.RemoteException
unregisterFromGameManager
void unregisterFromGameManager()
throws java.rmi.AccessException,
java.rmi.RemoteException,
java.rmi.NotBoundException
- Throws:
java.rmi.AccessException
java.rmi.RemoteException
java.rmi.NotBoundException
main
public static void main(java.lang.String[] args)
- Parameters:
args
-
sleepFor
private static void sleepFor(long millis)