|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread edu.sdsc.inca.agent.ReporterManagerTable
public class ReporterManagerTable
Convenience class for storing and tracking reporter managers. This wraps a Hashtable and provides functions specifically for working with reporter manager objects (e.g., you don't have to cast an object after getting it). It also is a thread that checks the viability of reporter managers. In the case that a reporter manager starter thread gets stuck, this thread will force a restart. This class is thread-safe.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
static long |
MAX_START_TIME
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
ReporterManagerTable()
|
Method Summary | |
---|---|
boolean |
containsResource(java.lang.String resource)
Returns true if the specified resource exists in the table. |
ReporterManagerController |
get(java.lang.String resource)
Returns the reporter manager if it exists in the table regardless if it's running or not. |
int |
getCheckPeriod()
Get the frequency of which this thread should check the health of the reporter managers. |
java.lang.String[] |
getResourceNames()
Return the a list of resources who have reporter managers stored in the table. |
void |
put(java.lang.String resource,
ReporterManagerController rm)
Add a reporter manager to the table. |
void |
remove(java.lang.String resource)
Removes the specified reporter manager from the table. |
void |
run()
Check all reporter manager periodically to see if they are still running. |
void |
setCheckPeriod(int checkPeriod)
Set the frequency of which the thread should check the health of the reporter managers. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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 |
---|
public static long MAX_START_TIME
Constructor Detail |
---|
public ReporterManagerTable()
Method Detail |
---|
public boolean containsResource(java.lang.String resource)
resource
- A resource name from the resource configuration file.
public ReporterManagerController get(java.lang.String resource)
resource
-
public int getCheckPeriod()
public java.lang.String[] getResourceNames()
public void put(java.lang.String resource, ReporterManagerController rm)
resource
- A string for retrieving the reporter manager from the
table.rm
- A reporter manager to store in the table.public void remove(java.lang.String resource)
resource
- The name of the resource whose reporter manager
should be removed from the table.public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void setCheckPeriod(int checkPeriod)
checkPeriod
- Period in milliseconds.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |