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 booleanprivate Fileprivate final Stringprivate static final Loggerprivate PrintWriterFields inherited from interface INotifyWebServer
ALL_CLIENTS_CONNECTED, GAME_STARTUP_COMPLETED, GAME_STARTUP_FAILED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprivate voidvoidvoidgameStartupFailed(String reason) voidbooleanisActive()voidprivate voidvoid
-
Field Details
-
LOGGER
-
flagFilename
-
out
-
flagFile
-
active
private final boolean active
-
-
Constructor Details
-
NotifyWebServerViaFile
-
-
Method Details
-
isActive
public boolean isActive()- Specified by:
isActivein interfaceINotifyWebServer
-
readyToAcceptClients
public void readyToAcceptClients()- Specified by:
readyToAcceptClientsin interfaceINotifyWebServer
-
gotClient
- Specified by:
gotClientin interfaceINotifyWebServer
-
allClientsConnected
public void allClientsConnected()- Specified by:
allClientsConnectedin interfaceINotifyWebServer
-
gameStartupCompleted
public void gameStartupCompleted()- Specified by:
gameStartupCompletedin interfaceINotifyWebServer
-
gameStartupFailed
- Specified by:
gameStartupFailedin interfaceINotifyWebServer
-
serverStoppedRunning
public void serverStoppedRunning()- Specified by:
serverStoppedRunningin interfaceINotifyWebServer
-
createFlagfile
private void createFlagfile() -
removeFlagfile
private void removeFlagfile()
-