|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread de.netseeker.ejoe.ConnectionProcessorManager
The ConnectionProcessorManager handles the further processing of accepted client connections. It simply does only separate the readable connections from the incoming flood of accepted connections and schedules a new ConnectionProcessor which will handle read/write operations and adapter invoking for each of the selected connections. This is compareable to the *old BIO style* where one thread is used for each connection.
Field Summary |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
ConnectionProcessorManager(ConnectionHeader serverInfo,
ServerHandler handler,
int maxReadProcessors,
int maxWriteProcessors)
Creates a new ConnectionProcessorManager instance. |
|
ConnectionProcessorManager(ConnectionHeader serverInfo,
ServerHandler handler,
int maxProcessors,
int maxWriteProcessors,
boolean useThreadedReadProcessors)
Creates a new ConnectionProcessorManager instance |
Method Summary | |
boolean |
isValid()
Tells whether this ChannelRegistrar is running and accepting channels for further processing |
void |
register(ConnectionHeader clientInfo,
int interest)
(Re-)Adds a incomplete read channel to the list of channels processed by the Selector of this ChannelRegistrar |
void |
run()
|
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 |
Constructor Detail |
public ConnectionProcessorManager(ConnectionHeader serverInfo, ServerHandler handler, int maxReadProcessors, int maxWriteProcessors) throws java.io.IOException
serverInfo
- prefilled ConnectionHeader container server settings, eg. compression settinghandler
- server handler to use when processing retrieved datamaxReadProcessors
- amount of read processors threads to use for reading data and processing these retrieved datamaxWriteProcessors
- amount of writer threads to use for sending server responses to clients
java.io.IOException
public ConnectionProcessorManager(ConnectionHeader serverInfo, ServerHandler handler, int maxProcessors, int maxWriteProcessors, boolean useThreadedReadProcessors) throws java.io.IOException
serverInfo
- prefilled ConnectionHeader container server settings, eg. compression settinghandler
- server handler to use when processing retrieved datamaxWriteProcessors
- amount of writer threads to use for sending server responses to clientsuseThreadedReadProcessors
- whether to use a blocking thread start mechanism, which will invoke new read processor threads not
until the amount of concurrently running read processors is lower than maxReadProcessors
java.io.IOException
Method Detail |
public void run()
run
in interface java.lang.Runnable
public void register(ConnectionHeader clientInfo, int interest)
ChannelRegistrar
register
in interface ChannelRegistrar
clientInfo
- the ConnectionHeader initially sent by the receiverinterest
- OP_WRITE or OP_READ interestpublic boolean isValid()
ChannelRegistrar
isValid
in interface ChannelRegistrar
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |