Package cruise.umple
Class PlaygroundMain
java.lang.Object
cruise.umple.AbstractServer
cruise.umple.PlaygroundMain
- All Implemented Interfaces:
java.lang.Runnable
public class PlaygroundMain extends AbstractServer
-
Constructor Summary
Constructors Constructor Description PlaygroundMain(int port)
PlaygroundMain(java.lang.Thread aConnectionListener, int aPort, java.lang.ThreadGroup aClientThreadGroup)
-
Method Summary
Modifier and Type Method Description java.lang.String
concatForLog(java.lang.String[] theCommand)
void
delete()
int
getAddClassCommandsRun()
int
getAddPositioningCommandsRun()
int
getCheckpoint2CommandsRun()
long
getCheckpoint2MaxElapsed()
long
getCheckpoint2Time()
int
getCheckpointCommandsRun()
long
getCheckpointMaxElapsed()
long
getCheckpointTime()
int
getCommandsEverRun()
int
getCommandsRun()
int
getCpDiffCmds()
long
getCpDiffTime()
int
getEditClassCommandsRun()
int
getGenerateGvClassDiagramCommandsRun()
int
getGenerateGvStateDiagramCommandsRun()
int
getGenerateJsonCommandsRun()
int
getGenerateJsonMixedCommandsRun()
boolean
getIsServer()
long
getLastCommandElapsed()
long
getLastCommandEndTime()
long
getLastCommandStartTime()
int
getLogCommandsRun()
long
getMaxElapsed()
long
getPreviousCommandElapsed()
long
getPreviousCommandEndTime()
int
getSourceCommandsRun()
void
handleMessageFromClient(java.lang.String msg, ConnectionToClient client)
A command arriving when this is a serverboolean
isIsServer()
static void
main(java.lang.String[] args)
The main method when started from the command linevoid
processCommand(java.lang.String[] args, ConnectionToClient client)
Process arguments either from the command line, or through a socket If through a socket, the socket must be closed after returningvoid
returnCommandResult(java.lang.String resultToOutput, ConnectionToClient client)
protected void
serverClosed()
Hook method called when the server is clased.protected void
serverStarted()
Hook method called when the server starts listening for connections.protected void
serverStopped()
Hook method called when the server stops accepting connections.boolean
setAddClassCommandsRun(int aAddClassCommandsRun)
boolean
setAddPositioningCommandsRun(int aAddPositioningCommandsRun)
boolean
setCheckpoint2CommandsRun(int aCheckpoint2CommandsRun)
boolean
setCheckpoint2MaxElapsed(long aCheckpoint2MaxElapsed)
boolean
setCheckpoint2Time(long aCheckpoint2Time)
boolean
setCheckpointCommandsRun(int aCheckpointCommandsRun)
boolean
setCheckpointMaxElapsed(long aCheckpointMaxElapsed)
boolean
setCheckpointTime(long aCheckpointTime)
boolean
setCommandsEverRun(int aCommandsEverRun)
boolean
setCommandsRun(int aCommandsRun)
boolean
setCpDiffCmds(int aCpDiffCmds)
boolean
setCpDiffTime(long aCpDiffTime)
boolean
setEditClassCommandsRun(int aEditClassCommandsRun)
boolean
setGenerateGvClassDiagramCommandsRun(int aGenerateGvClassDiagramCommandsRun)
boolean
setGenerateGvStateDiagramCommandsRun(int aGenerateGvStateDiagramCommandsRun)
boolean
setGenerateJsonCommandsRun(int aGenerateJsonCommandsRun)
boolean
setGenerateJsonMixedCommandsRun(int aGenerateJsonMixedCommandsRun)
boolean
setIsServer(boolean aIsServer)
boolean
setLastCommandElapsed(long aLastCommandElapsed)
boolean
setLastCommandEndTime(long aLastCommandEndTime)
boolean
setLastCommandStartTime(long aLastCommandStartTime)
boolean
setLogCommandsRun(int aLogCommandsRun)
boolean
setMaxElapsed(long aMaxElapsed)
boolean
setPreviousCommandElapsed(long aPreviousCommandElapsed)
boolean
setPreviousCommandEndTime(long aPreviousCommandEndTime)
boolean
setSourceCommandsRun(int aSourceCommandsRun)
java.lang.String
toString()
Methods inherited from class cruise.umple.AbstractServer
clientConnected, clientDisconnected, clientException, close, getBacklog, getClientConnections, getClientThreadGroup, getConnectionListener, getNumberOfClients, getPort, getReadyToStop, getServerSocket, getTimeout, isClosed, isListening, listen, listeningException, run, sendToAllClients, setBacklog, setClientThreadGroup, setConnectionListener, setPort, setReadyToStop, setServerSocket, setTimeout, stopListening
-
Constructor Details
-
PlaygroundMain
public PlaygroundMain(java.lang.Thread aConnectionListener, int aPort, java.lang.ThreadGroup aClientThreadGroup) -
PlaygroundMain
public PlaygroundMain(int port)
-
-
Method Details
-
setIsServer
public boolean setIsServer(boolean aIsServer) -
setCommandsRun
public boolean setCommandsRun(int aCommandsRun) -
setCommandsEverRun
public boolean setCommandsEverRun(int aCommandsEverRun) -
setCheckpointCommandsRun
public boolean setCheckpointCommandsRun(int aCheckpointCommandsRun) -
setCheckpoint2CommandsRun
public boolean setCheckpoint2CommandsRun(int aCheckpoint2CommandsRun) -
setCpDiffCmds
public boolean setCpDiffCmds(int aCpDiffCmds) -
setCpDiffTime
public boolean setCpDiffTime(long aCpDiffTime) -
setLogCommandsRun
public boolean setLogCommandsRun(int aLogCommandsRun) -
setAddClassCommandsRun
public boolean setAddClassCommandsRun(int aAddClassCommandsRun) -
setEditClassCommandsRun
public boolean setEditClassCommandsRun(int aEditClassCommandsRun) -
setAddPositioningCommandsRun
public boolean setAddPositioningCommandsRun(int aAddPositioningCommandsRun) -
setSourceCommandsRun
public boolean setSourceCommandsRun(int aSourceCommandsRun) -
setGenerateJsonCommandsRun
public boolean setGenerateJsonCommandsRun(int aGenerateJsonCommandsRun) -
setGenerateJsonMixedCommandsRun
public boolean setGenerateJsonMixedCommandsRun(int aGenerateJsonMixedCommandsRun) -
setGenerateGvClassDiagramCommandsRun
public boolean setGenerateGvClassDiagramCommandsRun(int aGenerateGvClassDiagramCommandsRun) -
setGenerateGvStateDiagramCommandsRun
public boolean setGenerateGvStateDiagramCommandsRun(int aGenerateGvStateDiagramCommandsRun) -
setLastCommandStartTime
public boolean setLastCommandStartTime(long aLastCommandStartTime) -
setLastCommandEndTime
public boolean setLastCommandEndTime(long aLastCommandEndTime) -
setLastCommandElapsed
public boolean setLastCommandElapsed(long aLastCommandElapsed) -
setPreviousCommandElapsed
public boolean setPreviousCommandElapsed(long aPreviousCommandElapsed) -
setPreviousCommandEndTime
public boolean setPreviousCommandEndTime(long aPreviousCommandEndTime) -
setCheckpointTime
public boolean setCheckpointTime(long aCheckpointTime) -
setCheckpoint2Time
public boolean setCheckpoint2Time(long aCheckpoint2Time) -
setMaxElapsed
public boolean setMaxElapsed(long aMaxElapsed) -
setCheckpointMaxElapsed
public boolean setCheckpointMaxElapsed(long aCheckpointMaxElapsed) -
setCheckpoint2MaxElapsed
public boolean setCheckpoint2MaxElapsed(long aCheckpoint2MaxElapsed) -
getIsServer
public boolean getIsServer() -
getCommandsRun
public int getCommandsRun() -
getCommandsEverRun
public int getCommandsEverRun() -
getCheckpointCommandsRun
public int getCheckpointCommandsRun() -
getCheckpoint2CommandsRun
public int getCheckpoint2CommandsRun() -
getCpDiffCmds
public int getCpDiffCmds() -
getCpDiffTime
public long getCpDiffTime() -
getLogCommandsRun
public int getLogCommandsRun() -
getAddClassCommandsRun
public int getAddClassCommandsRun() -
getEditClassCommandsRun
public int getEditClassCommandsRun() -
getAddPositioningCommandsRun
public int getAddPositioningCommandsRun() -
getSourceCommandsRun
public int getSourceCommandsRun() -
getGenerateJsonCommandsRun
public int getGenerateJsonCommandsRun() -
getGenerateJsonMixedCommandsRun
public int getGenerateJsonMixedCommandsRun() -
getGenerateGvClassDiagramCommandsRun
public int getGenerateGvClassDiagramCommandsRun() -
getGenerateGvStateDiagramCommandsRun
public int getGenerateGvStateDiagramCommandsRun() -
getLastCommandStartTime
public long getLastCommandStartTime() -
getLastCommandEndTime
public long getLastCommandEndTime() -
getLastCommandElapsed
public long getLastCommandElapsed() -
getPreviousCommandElapsed
public long getPreviousCommandElapsed() -
getPreviousCommandEndTime
public long getPreviousCommandEndTime() -
getCheckpointTime
public long getCheckpointTime() -
getCheckpoint2Time
public long getCheckpoint2Time() -
getMaxElapsed
public long getMaxElapsed() -
getCheckpointMaxElapsed
public long getCheckpointMaxElapsed() -
getCheckpoint2MaxElapsed
public long getCheckpoint2MaxElapsed() -
isIsServer
public boolean isIsServer() -
delete
public void delete()- Overrides:
delete
in classAbstractServer
-
main
public static void main(java.lang.String[] args)The main method when started from the command line -
handleMessageFromClient
A command arriving when this is a server- Specified by:
handleMessageFromClient
in classAbstractServer
- Parameters:
msg
- the message sent.client
- the connection connected to the client that sent the message.
-
returnCommandResult
-
processCommand
Process arguments either from the command line, or through a socket If through a socket, the socket must be closed after returning -
serverStarted
protected void serverStarted()Description copied from class:AbstractServer
Hook method called when the server starts listening for connections. The default implementation does nothing. The method may be overridden by subclasses.- Overrides:
serverStarted
in classAbstractServer
-
serverStopped
protected void serverStopped()Description copied from class:AbstractServer
Hook method called when the server stops accepting connections. The default implementation does nothing. This method may be overriden by subclasses.- Overrides:
serverStopped
in classAbstractServer
-
serverClosed
protected void serverClosed()Description copied from class:AbstractServer
Hook method called when the server is clased. The default implementation does nothing. This method may be overriden by subclasses. When the server is closed while still listening, serverStopped() will also be called.- Overrides:
serverClosed
in classAbstractServer
-
concatForLog
public java.lang.String concatForLog(java.lang.String[] theCommand) -
toString
public java.lang.String toString()- Overrides:
toString
in classAbstractServer
-