de.netseeker.ejoe.core
Class CombinedConnectionProcessor

java.lang.Object
  extended by java.lang.Thread
      extended by de.netseeker.ejoe.core.CombinedConnectionProcessor
All Implemented Interfaces:
ChannelRegistrar, java.lang.Runnable

public final class CombinedConnectionProcessor
extends java.lang.Thread
implements ChannelRegistrar

The CombinedConnectionProcessor 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.

Since:
0.3.5
Author:
netseeker

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
CombinedConnectionProcessor(ServerInfo serverInfo)
          Creates a new CombinedConnectionProcessor instance.
 
Method Summary
 int getLoad()
          Returns the amount of currently queued network events for processing
 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, 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
 

Constructor Detail

CombinedConnectionProcessor

public CombinedConnectionProcessor(ServerInfo serverInfo)
                            throws java.io.IOException
Creates a new CombinedConnectionProcessor instance. Using this constructor will force the newly created instance to use a non-blocking threadpool for invocation of read processor threads.

Parameters:
serverInfo - prefilled ConnectionHeader container server settings, eg. compression setting
Throws:
java.io.IOException
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

register

public void register(ConnectionHeader clientInfo,
                     int interest)
Description copied from interface: ChannelRegistrar
(Re-)Adds a incomplete read channel to the list of channels processed by the Selector of this ChannelRegistrar

Specified by:
register in interface ChannelRegistrar
Parameters:
clientInfo - the ConnectionHeader initially sent by the receiver
interest - OP_WRITE or OP_READ interest

isValid

public boolean isValid()
Description copied from interface: ChannelRegistrar
Tells whether this ChannelRegistrar is running and accepting channels for further processing

Specified by:
isValid in interface ChannelRegistrar
Returns:
true if this ChannelRegistrar is running and accepting channels for further processing otherwise false

getLoad

public int getLoad()
Description copied from interface: ChannelRegistrar
Returns the amount of currently queued network events for processing

Specified by:
getLoad in interface ChannelRegistrar
Returns:
the amount of currently queued network events for processing


Copyright © 2005-2007 netseeker. All Rights Reserved.