|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.flat502.rox.processing.ResourcePool
public abstract class ResourcePool
Constructor Summary | |
---|---|
protected |
ResourcePool()
|
Method Summary | |
---|---|
int |
addWorker()
Create a new worker instance and add it to the underlying thread pool. |
int |
addWorkers(int count)
A convenience method for adding multiple worker threads in a single call. |
protected void |
detach(HttpRpcProcessor processor)
|
protected com.flat502.rox.processing.ChannelSelector |
getChannelSelector()
|
protected ProfilerCollection |
getProfilers()
|
BlockingQueue |
getQueue()
|
protected java.util.Timer |
getTimer()
|
int |
getWorkerCount()
Get the number of worker threads currently responsible for this instance. |
protected com.flat502.rox.processing.ChannelSelector |
newChannelSelector()
|
protected java.lang.Thread |
newProcessingThread(java.lang.Runnable target)
A factory method for creating the central HTTP processing thread. |
protected BlockingQueue |
newQueue()
|
protected abstract HttpMessageHandler |
newWorker()
|
protected void |
notifyUnownedChannelClosure(java.nio.channels.SocketChannel channel)
|
void |
registerProfiler(Profiler p)
|
int |
removeWorker()
|
void |
shutdown()
|
protected void |
startProcessingThread()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ResourcePool()
Method Detail |
---|
protected com.flat502.rox.processing.ChannelSelector getChannelSelector() throws java.io.IOException
java.io.IOException
protected java.util.Timer getTimer()
protected void startProcessingThread()
public BlockingQueue getQueue()
public void shutdown()
public int addWorker()
Worker threads are responsible for handling complete HTTP messages. All I/O is handled by this thread instance alone.
If an instance of this class is constructed and started without this method having been invoked it will be invoked before processing begins.
public int addWorkers(int count)
count
- The number of worker threads to add.
public int getWorkerCount()
public int removeWorker()
public void registerProfiler(Profiler p)
protected ProfilerCollection getProfilers()
protected abstract HttpMessageHandler newWorker()
protected java.lang.Thread newProcessingThread(java.lang.Runnable target)
Sub-classes may override this method if an alternative
implementation is required, or to alter properties of
the thread that is created by default, but they should
not invoke the Thread.start()
method.
target
-
HttpRpcProcessor
.protected com.flat502.rox.processing.ChannelSelector newChannelSelector() throws java.io.IOException
java.io.IOException
protected void detach(HttpRpcProcessor processor) throws java.io.IOException
java.io.IOException
protected void notifyUnownedChannelClosure(java.nio.channels.SocketChannel channel)
protected BlockingQueue newQueue()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |