|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgcspy.comm.CommandStream
gcspy.interpreter.Interpreter
gcspy.interpreter.server.ServerInterpreter
public class ServerInterpreter
The server interpreter
Nested Class Summary |
---|
Nested classes/interfaces inherited from class gcspy.interpreter.Interpreter |
---|
Interpreter.BootstrapParameters |
Field Summary |
---|
Fields inherited from class gcspy.interpreter.Interpreter |
---|
client, CONTROL_CMD, DEFAULT_MAX_LEN, EVENT_CMD, EVENT_COUNT_CMD, EVENT_FILTERS_CMD, eventCount, eventFilters, events, generalInfo, name, PAUSE_CMD, PAUSE_REQ_CMD, PLAY_ONE_CMD, RESTART_CMD, SHUTDOWN_CMD, SHUTDOWN_REQ_CMD, SPACE_CMD, SPACE_INFO_CMD, spaceNum, spaces, STREAM_CMD, SUMMARY_CMD |
Fields inherited from class gcspy.comm.CommandStream |
---|
cmds, FIRST_AVAILABLE_CMD, max, output |
Constructor Summary | |
---|---|
ServerInterpreter(java.lang.String name,
boolean collectStats)
Create a new server interpreter |
|
ServerInterpreter(java.lang.String name,
boolean collectStats,
Events events,
int spaceNum)
Create a new server interpreter |
Method Summary | |
---|---|
int |
addServerSpace(ServerSpace space)
Add a server space to the interpreter |
void |
countingEventBoundary(int eventID)
Indicate an event boundary and update counters if necessary |
void |
eventBoundary(int eventID,
int elapsedTime,
int compensationTime)
Indicate an event boundary |
ServerSpace |
getServerSpace(int i)
Get a server space |
protected void |
internalSetup()
Set up a connection. |
void |
run()
Start the main interpreter thread loop |
void |
safepoint()
Indicate a safe point |
void |
sendControl(int spaceID,
byte[] control)
Send a control stream for a space |
void |
sendEvent(int eventID,
int elapsedTime,
int compensationTime)
Send an event |
void |
sendEventCount()
Send the event count |
void |
sendPause()
Send a PAUSE comand |
void |
sendShutdown()
Senf a SHUT_DOWN command |
void |
sendSpace(Space space)
Send a space |
void |
sendSpaceInfo(int spaceID,
java.lang.String spaceInfo)
Send the space information |
void |
sendStream(int spaceID,
int streamID,
int dataType,
java.lang.Object data)
Send a stream for a space |
void |
sendStream(int spaceID,
int streamID,
int dataType,
java.lang.Object data,
int len)
Send a stream for a space |
void |
sendSummary(int spaceID,
int streamID,
int[] summary)
Send the summary |
boolean |
shouldTransmit(int eventID)
Should this event be transmitted? |
void |
startCompensationTimer()
Start the compensation timer |
void |
startServer(int port)
Start the server |
void |
startServer(int port,
boolean wait)
Start the server |
void |
startServer(int port,
boolean wait,
int maxLen)
Start the server |
void |
stopCompensationTimer()
Stop the compensation timer |
void |
transmitStreams()
Transmit all the streams for all the spaces known to tis interpreter. |
void |
updateEventCounter(int eventID)
Update the event counter for an event |
Methods inherited from class gcspy.interpreter.Interpreter |
---|
deserialise, deserialiseEverything, dump, dumpSpaces, getEventCount, getEventFilters, getEvents, getGeneralInfo, getName, getSpace, getSpaceNum, println, receiveBootInfo, sendBootInfo, sendSingleCommand, serialise, serialiseEverything, setEventCount, setGeneralInfo, setSpace, setupEventCount, setupEventFilters, setVerbose |
Methods inherited from class gcspy.comm.CommandStream |
---|
execute, finish, finish, getCmd, putCmd, putCmd, setBufferedOutput, start, start |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServerInterpreter(java.lang.String name, boolean collectStats)
name
- The server's namecollectStats
- WHether to collect statisticspublic ServerInterpreter(java.lang.String name, boolean collectStats, Events events, int spaceNum)
name
- The server's namecollectStats
- Whether to collect statisticsevents
- The eventsspaceNum
- The number of spacesMethod Detail |
---|
public ServerSpace getServerSpace(int i)
i
- The space's ID
public int addServerSpace(ServerSpace space)
space
- The server space
public void transmitStreams() throws java.io.IOException
java.io.IOException
public void sendPause() throws java.io.IOException
java.io.IOException
public void sendShutdown() throws java.io.IOException
java.io.IOException
public void sendStream(int spaceID, int streamID, int dataType, java.lang.Object data) throws java.io.IOException
spaceID
- The space's IDstreamID
- The stream's IDdataType
- The stream's data typedata
- The stream's data
java.io.IOException
public void sendStream(int spaceID, int streamID, int dataType, java.lang.Object data, int len) throws java.io.IOException
spaceID
- The space's IDstreamID
- The stream's IDdataType
- The stream's data typedata
- The stream's datalen
- The length of the stream data
java.io.IOException
public void sendEvent(int eventID, int elapsedTime, int compensationTime) throws java.io.IOException
eventID
- The event's IDelapsedTime
- The elapsed time fo rthe eventcompensationTime
- The compensation time fo rthe event
java.io.IOException
public void sendControl(int spaceID, byte[] control) throws java.io.IOException
spaceID
- The space's IDcontrol
- The controls
java.io.IOException
public void sendEventCount() throws java.io.IOException
java.io.IOException
public void sendSummary(int spaceID, int streamID, int[] summary) throws java.io.IOException
spaceID
- The space's IDstreamID
- The stream's IDsummary
- The summary values
java.io.IOException
public void sendSpaceInfo(int spaceID, java.lang.String spaceInfo) throws java.io.IOException
spaceID
- The space's IDspaceInfo
- The space information
java.io.IOException
public void sendSpace(Space space) throws java.io.IOException
space
- The space
java.io.IOException
public void startServer(int port) throws java.io.IOException
port
- The port on which to communicate
java.io.IOException
public void startServer(int port, boolean wait) throws java.io.IOException
port
- The port on which to communicatewait
- Whether to wait until client connects
java.io.IOException
public void startServer(int port, boolean wait, int maxLen) throws java.io.IOException
port
- The port on which to communicatewait
- Whether to wait until client connectsmaxLen
- The buffer length
java.io.IOException
public void startCompensationTimer()
public void stopCompensationTimer()
public void run()
run
in interface java.lang.Runnable
public void safepoint()
public void updateEventCounter(int eventID)
eventID
- The event's IDpublic void eventBoundary(int eventID, int elapsedTime, int compensationTime)
eventID
- The event's IDelapsedTime
- The elapsed time at this eventcompensationTime
- The compensation timepublic void countingEventBoundary(int eventID)
eventID
- The event's IDpublic boolean shouldTransmit(int eventID)
eventID
- The event ID
protected void internalSetup()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |