public abstract class ServerInterpreter extends Object
Implementing classes will mostly forward calls to the C gcspy library.
Modifier and Type | Field and Description |
---|---|
protected static boolean |
DEBUG |
protected static boolean |
initialised |
protected static int |
MAX_LEN |
protected static int |
MAX_SPACES |
protected Address |
server |
protected ServerSpace[] |
spaces |
Constructor and Description |
---|
ServerInterpreter() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addEvent(int num,
String name)
Add an event to the ServerInterpreter.
|
int |
addSpace(ServerSpace space)
Add a GCspy ServerSpace to the ServerInterpreter.
|
abstract int |
computeHeaderSize()
Discover the smallest header size for objects.
|
Address |
getServerAddress()
Get a pointer to the C server, gcspy_main_server_t.
|
abstract void |
init(String name,
int port,
boolean verbose)
Create a new ServerInterpreter singleton.
|
abstract boolean |
isConnected(int event)
Are we connected to a GCspy client?
|
abstract void |
serverSafepoint(int event)
Indicate that we are at a server safe point (e.g. the end of a GC).
|
abstract void |
setGeneralInfo(String info)
Set the general info for the ServerInterpreter.
|
abstract void |
startCompensationTimer()
Start compensation timer so that time spent gathering data is
not confused with the time spent in the application and the VM.
|
abstract void |
startServer(boolean wait)
Start the server, running its main loop in a pthread.
|
abstract 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
|
protected static final int MAX_LEN
protected static final int MAX_SPACES
protected static boolean initialised
protected ServerSpace[] spaces
protected static final boolean DEBUG
public ServerInterpreter()
public abstract void init(String name, int port, boolean verbose)
name
- The name of the serverport
- The number of the port on which to communicateverbose
- Whether the server is to run verboselypublic abstract void addEvent(int num, String name)
num
- the event numbername
- the event namepublic abstract void setGeneralInfo(String info)
info
- the informationpublic Address getServerAddress()
public int addSpace(ServerSpace space)
space
- the ServerSpace to addIndexOutOfBoundsException
- on attempt to add more than
MAX_SPACES spacespublic abstract void startServer(boolean wait)
wait
- Whether to wait for the client to connectpublic abstract boolean isConnected(int event)
event
- The current eventtrue
if we are connectedpublic abstract void startCompensationTimer()
public abstract void stopCompensationTimer()
public abstract void serverSafepoint(int event)
event
- The current eventpublic abstract int computeHeaderSize()