protected class TThreadedSelectorServerWithFix.SelectorThread extends Thread
Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
SelectorThread()
Set up the SelectorThread with an unbounded queue for incoming accepts.
|
SelectorThread(BlockingQueue<org.apache.thrift.transport.TNonblockingTransport> acceptedQueue)
Set up the SelectorThread with a specified queue for connections.
|
SelectorThread(int maxPendingAccepts)
Set up the SelectorThread with an bounded queue for incoming accepts.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addAcceptedConnection(org.apache.thrift.transport.TNonblockingTransport accepted)
Hands off an accepted connection to be handled by this thread.
|
void |
run()
The work loop.
|
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, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public SelectorThread() throws IOException
IOException
- if a selector cannot be createdpublic SelectorThread(int maxPendingAccepts) throws IOException
IOException
- if a selector cannot be createdpublic SelectorThread(BlockingQueue<org.apache.thrift.transport.TNonblockingTransport> acceptedQueue) throws IOException
acceptedQueue
- The BlockingQueue implementation for holding incoming accepted
connections.IOException
- if a selector cannot be created.public boolean addAcceptedConnection(org.apache.thrift.transport.TNonblockingTransport accepted)
accepted
- The connection that has been accepted.Copyright © 2018 The Apache Software Foundation. All rights reserved.