|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
ParkNPark.client.FaultTolerantClientManager.BackgroundThread
protected class FaultTolerantClientManager.BackgroundThread
Background thread that performs the following actions in a loop continuously:
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
protected int |
detectionTimeout
The fault detection timeout |
protected boolean |
exit
True when we should exit or false when we should not |
protected SortedMap<Long,Server> |
faultyServers
Map of fault detection times to their faulty servers |
protected NameService |
nameService
Our name server instance |
protected int |
serverIndex
The index of the current server in the list of servers |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
FaultTolerantClientManager.BackgroundThread(ORB orb,
int detectionTimeout)
Creates a new background thread instance |
Method Summary | |
---|---|
void |
beginExit()
Tells this thread to gracefully shut down |
protected boolean |
connectToAnyServer(LogEntry logEntry)
Connects to any registered server, which is chosen randomly |
protected boolean |
findPrimary()
Finds the primary server in the List of servers and returns whether or not one was found |
protected boolean |
initialConnection()
Create the initial connection to a server and return whether or not it worked |
protected void |
processFaultyServers()
Maintains the faulty server list and removes them from the current set of servers. |
void |
run()
Background thread's execution |
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 |
---|
protected NameService nameService
protected int serverIndex
protected int detectionTimeout
protected boolean exit
protected SortedMap<Long,Server> faultyServers
Constructor Detail |
---|
public FaultTolerantClientManager.BackgroundThread(ORB orb, int detectionTimeout)
orb
- The ORB to operate withdetectionTimeout
- The fault detection timeout to useMethod Detail |
---|
public void beginExit()
public void run()
run
in interface Runnable
run
in class Thread
protected void processFaultyServers()
protected boolean initialConnection()
protected boolean findPrimary()
protected boolean connectToAnyServer(LogEntry logEntry)
logEntry
- The LogEntry object to write performance data
to when not null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |