public class ServerInterpreter extends ServerInterpreter
This class implements the GCspy server. The server runs as a separate pthread and communicates with GCspy clients. It handles commands from the client and passes data to it. Mostly it forwards calls to the C gcspy library.
DEBUG, initialised, MAX_LEN, MAX_SPACES, server, spaces
Constructor and Description |
---|
ServerInterpreter() |
Modifier and Type | Method and Description |
---|---|
void |
addEvent(int num,
String name)
Add an event to the ServerInterpreter.
|
int |
computeHeaderSize()
Discover the smallest header size for objects.
|
void |
init(String name,
int port,
boolean verbose)
Create a new ServerInterpreter singleton.
|
boolean |
isConnected(int event)
Are we connected to a GCspy client?
|
void |
serverSafepoint(int event)
Indicate that we are at a server safe point (e.g. the end of a GC).
|
void |
setGeneralInfo(String info)
Set the general info for the ServerInterpreter.
|
void |
startCompensationTimer()
Start compensation timer so that time spent gathering data is
not confused with the time spent in the application and the VM.
|
void |
startServer(boolean wait)
Start the server, running its main loop in a pthread.
|
void |
stopCompensationTimer()
Stop compensation timer so that time spent gathering data is
not confused with the time spent in the application and the VM.r
|
addSpace, getServerAddress
public ServerInterpreter()
public void init(String name, int port, boolean verbose)
ServerInterpreter
init
in class ServerInterpreter
name
- The name of the serverport
- The number of the port on which to communicateverbose
- Whether the server is to run verboselypublic void addEvent(int num, String name)
ServerInterpreter
addEvent
in class ServerInterpreter
num
- the event numbername
- the event namepublic void setGeneralInfo(String info)
ServerInterpreter
setGeneralInfo
in class ServerInterpreter
info
- the informationpublic void startServer(boolean wait)
ServerInterpreter
startServer
in class ServerInterpreter
wait
- Whether to wait for the client to connectpublic boolean isConnected(int event)
ServerInterpreter
isConnected
in class ServerInterpreter
event
- The current eventtrue
if we are connectedpublic void startCompensationTimer()
ServerInterpreter
startCompensationTimer
in class ServerInterpreter
public void stopCompensationTimer()
ServerInterpreter
stopCompensationTimer
in class ServerInterpreter
public void serverSafepoint(int event)
ServerInterpreter
serverSafepoint
in class ServerInterpreter
event
- The current eventpublic int computeHeaderSize()
ServerInterpreter
computeHeaderSize
in class ServerInterpreter