Package net.sf.colossus.server
Class NotifyWebServerViaFile
java.lang.Object
net.sf.colossus.server.NotifyWebServerViaFile
- All Implemented Interfaces:
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
FieldsModifier and TypeFieldDescriptionprivate final boolean
private File
private final String
private static final Logger
private PrintWriter
Fields inherited from interface net.sf.colossus.server.INotifyWebServer
ALL_CLIENTS_CONNECTED, GAME_STARTUP_COMPLETED, GAME_STARTUP_FAILED
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
private void
void
void
gameStartupFailed
(String reason) void
boolean
isActive()
void
private void
void
-
Field Details
-
LOGGER
-
flagFilename
-
out
-
flagFile
-
active
private final boolean active
-
-
Constructor Details
-
NotifyWebServerViaFile
-
-
Method Details
-
isActive
public boolean isActive()- Specified by:
isActive
in interfaceINotifyWebServer
-
readyToAcceptClients
public void readyToAcceptClients()- Specified by:
readyToAcceptClients
in interfaceINotifyWebServer
-
gotClient
- Specified by:
gotClient
in interfaceINotifyWebServer
-
allClientsConnected
public void allClientsConnected()- Specified by:
allClientsConnected
in interfaceINotifyWebServer
-
gameStartupCompleted
public void gameStartupCompleted()- Specified by:
gameStartupCompleted
in interfaceINotifyWebServer
-
gameStartupFailed
- Specified by:
gameStartupFailed
in interfaceINotifyWebServer
-
serverStoppedRunning
public void serverStoppedRunning()- Specified by:
serverStoppedRunning
in interfaceINotifyWebServer
-
createFlagfile
private void createFlagfile() -
removeFlagfile
private void removeFlagfile()
-