com.sleepycat.je.rep.elections
Class ElectionAgentThread
java.lang.Object
java.lang.Thread
com.sleepycat.je.utilint.StoppableThread
com.sleepycat.je.rep.elections.ElectionAgentThread
- All Implemented Interfaces:
- ExceptionListenerUser, Runnable
- Direct Known Subclasses:
- Acceptor, Learner
public class ElectionAgentThread
- extends StoppableThread
ElectionAgentThread is the base class for the election agent threads
underlying the Acceptor and Learner agents.
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, clone, 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, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
protocol
protected final Protocol protocol
logger
protected final Logger logger
formatter
protected final Formatter formatter
channelQueue
protected final BlockingQueue<SocketChannel> channelQueue
ElectionAgentThread
protected ElectionAgentThread(RepNode repNode,
Protocol protocol,
String threadName)
getLogger
protected Logger getLogger()
- Specified by:
getLogger
in class StoppableThread
- Returns:
- a logger to use when logging uncaught exceptions.
shutdown
public void shutdown()
throws InterruptedException
- Shuts down the Agent.
- Throws:
InterruptedException
initiateSoftShutdown
protected int initiateSoftShutdown()
- Description copied from class:
StoppableThread
- Threads that use shutdownThread() must define this method. It's invoked
by shutdownThread as an attempt at a soft shutdown.
This method makes provisions for this thread to exit on its own. The
technique used to make the thread exit can vary based upon the nature of
the service being provided by the thread. For example, the thread may be
known to poll some shutdown flag on a periodic basis, or it may detect
that a channel that it waits on has been closed by this method.
- Overrides:
initiateSoftShutdown
in class StoppableThread
- Returns:
- the amount of time in ms that the shutdownThread method will
wait for the thread to exit. A -ve value means that the method will not
wait. A zero value means it will wait indefinitely.
Copyright (c) 2004-2012 Oracle. All rights reserved.