net.sf.colossus.server
Class NotifyWebServerViaFile
java.lang.Object
net.sf.colossus.server.NotifyWebServerViaFile
- All Implemented Interfaces:
- INotifyWebServer
public class NotifyWebServerViaFile
- extends java.lang.Object
- implements INotifyWebServer
For communication between Game/Server and WebServer.
Perhaps later replaced with a two-way socket connection?
Class is always created, no matter whether we have a web
server ( => active == true) or not ( => active == false);
but this way, we can have all the
"if (we have a web server) { } "
checking done inside this class and do not clutter the
main server code.
Field Summary |
private boolean |
active
|
private java.io.File |
flagFile
|
private java.lang.String |
flagFilename
|
private static java.util.logging.Logger |
LOGGER
|
private java.io.PrintWriter |
out
|
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
flagFilename
private final java.lang.String flagFilename
out
private java.io.PrintWriter out
flagFile
private java.io.File flagFile
active
private final boolean active
NotifyWebServerViaFile
public NotifyWebServerViaFile(java.lang.String name)
isActive
public boolean isActive()
- Specified by:
isActive
in interface INotifyWebServer
readyToAcceptClients
public void readyToAcceptClients()
- Specified by:
readyToAcceptClients
in interface INotifyWebServer
gotClient
public void gotClient(java.lang.String playerName,
boolean remote)
- Specified by:
gotClient
in interface INotifyWebServer
allClientsConnected
public void allClientsConnected()
- Specified by:
allClientsConnected
in interface INotifyWebServer
gameStartupCompleted
public void gameStartupCompleted()
- Specified by:
gameStartupCompleted
in interface INotifyWebServer
serverStoppedRunning
public void serverStoppedRunning()
- Specified by:
serverStoppedRunning
in interface INotifyWebServer
createFlagfile
private void createFlagfile()
removeFlagfile
private void removeFlagfile()