org.glassfish.grizzly.strategies
Class AbstractIOStrategy

java.lang.Object
  extended by org.glassfish.grizzly.strategies.AbstractIOStrategy
All Implemented Interfaces:
IOStrategy, WorkerThreadPoolConfigProducer
Direct Known Subclasses:
LeaderFollowerNIOStrategy, SameThreadIOStrategy, WorkerThreadIOStrategy

public abstract class AbstractIOStrategy
extends java.lang.Object
implements IOStrategy

Author:
oleksiys

Field Summary
protected static IOEventProcessingHandler ENABLE_INTEREST_PROCESSING_HANDLER
           
 
Constructor Summary
AbstractIOStrategy()
           
 
Method Summary
 ThreadPoolConfig createDefaultWorkerPoolConfig(Transport transport)
           
 boolean executeIoEvent(Connection connection, IOEvent ioEvent)
          The SelectorRunner will invoke this method to allow the strategy implementation to decide how the IOEvent will be handled.
protected static void fireIOEvent(Connection connection, IOEvent ioEvent, IOEventProcessingHandler ph, java.util.logging.Logger logger)
           
protected static java.util.concurrent.Executor getWorkerThreadPool(Connection c)
           
protected static boolean isExecuteInWorkerThread(IOEvent ioEvent)
           
protected static boolean isReadWrite(IOEvent ioEvent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.glassfish.grizzly.IOStrategy
executeIoEvent
 

Field Detail

ENABLE_INTEREST_PROCESSING_HANDLER

protected static final IOEventProcessingHandler ENABLE_INTEREST_PROCESSING_HANDLER
Constructor Detail

AbstractIOStrategy

public AbstractIOStrategy()
Method Detail

createDefaultWorkerPoolConfig

public ThreadPoolConfig createDefaultWorkerPoolConfig(Transport transport)
Specified by:
createDefaultWorkerPoolConfig in interface WorkerThreadPoolConfigProducer

executeIoEvent

public final boolean executeIoEvent(Connection connection,
                                    IOEvent ioEvent)
                             throws java.io.IOException
Description copied from interface: IOStrategy
The SelectorRunner will invoke this method to allow the strategy implementation to decide how the IOEvent will be handled.

Specified by:
executeIoEvent in interface IOStrategy
Parameters:
connection - the Connection upon which the provided IOEvent occurred.
ioEvent - the IOEvent that triggered execution of this strategy
Returns:
true, if this thread should keep processing IOEvents on the current and other Connections, or false if this thread should hand-off the farther IOEvent processing on any Connections, which means IOStrategy is becoming responsible for continuing IOEvent processing (possibly starting new thread, which will handle IOEvents).
Throws:
java.io.IOException - if an error occurs processing the IOEvent.

isReadWrite

protected static boolean isReadWrite(IOEvent ioEvent)

isExecuteInWorkerThread

protected static boolean isExecuteInWorkerThread(IOEvent ioEvent)

getWorkerThreadPool

protected static java.util.concurrent.Executor getWorkerThreadPool(Connection c)

fireIOEvent

protected static void fireIOEvent(Connection connection,
                                  IOEvent ioEvent,
                                  IOEventProcessingHandler ph,
                                  java.util.logging.Logger logger)


Copyright © 2012 Oracle Corporation. All Rights Reserved.