|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--springs.access.AgentReferencesUpdater
Thread in charge of updating remote references to agents.
Field Summary | |
private springs.access.ReferenceUpdateCommands |
_remoteUpdateCommands
A vector with the names of agents whose remote references must be updated. |
private springs.access.StatisticsReferenceUpdate |
_st
For statistics computation. |
private boolean |
_terminate
A boolean indicating whether the thread must end its execution. |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
AgentReferencesUpdater()
Constructor. |
Method Summary | |
int |
getNToWait()
Gets the number of tuples to wait for, depending on the estimated tuple rate. |
boolean |
getTerminate()
Obtains if the thread must be terminated. |
void |
recordReferenceUpdateCommand(springs.access.ReferenceUpdateCommand rac)
Records instructions to update a reference. |
void |
removeCommand(java.lang.String agentName)
Removes a command that requests the update for an agent with the given name. |
void |
run()
Main method. |
void |
terminate()
Terminates the thread. |
private void |
waitUntil(int numCommands,
long timeout)
Blocks until there are as many commands as specified, with a maximum timeout, as long as there is at least one command waiting. |
private void |
waitUntilAtLeastOneCommand()
Blocks until there is at least one command to follow. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private boolean _terminate
private springs.access.ReferenceUpdateCommands _remoteUpdateCommands
ReferenceUpdateCommands
private springs.access.StatisticsReferenceUpdate _st
StatisticsReferenceUpdate
Constructor Detail |
public AgentReferencesUpdater()
Method Detail |
private void waitUntilAtLeastOneCommand()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void recordReferenceUpdateCommand(springs.access.ReferenceUpdateCommand rac)
rac
- the instructions.ReferenceUpdateCommand
public void removeCommand(java.lang.String agentName)
agentName
- the name of the agent.String
public void terminate()
public boolean getTerminate()
public int getNToWait()
private void waitUntil(int numCommands, long timeout)
numCommands
- the number of commands to wait for.timeout
- the maximum timeout (in milliseconds).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |