|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
com.sun.grizzly.http.SelectorThread
public class SelectorThread
The SelectorThread class is the entry point when embedding the Grizzly Web
Server. All Web Server configuration must be set on this object before invoking
the listen()
method. As an example:
final SelectorThread selectorThread = new SelectorThread(){
public void listen() throws IOException, InstantiationException{
super.listen();
System.out.println("Server started in " + (System.currentTimeMillis() - t1)
+ " milliseconds.");
}
};
selectorThread.setAlgorithmClassName(StaticStreamAlgorithm.class.getName());
selectorThread.setPort(port);
SelectorThread.setWebAppRootPath(folder);
Adapter adapter = new StaticResourcesAdapter(folder);
((StaticResourcesAdapter)adapter).setRootFolder(folder);
selectorThread.setAdapter(adapter);
selectorThread.setDisplayConfiguration(true);
selectorThread.listen();
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
protected ConcurrentLinkedQueue<ProcessorTask> |
activeProcessorTasks
List of active ProcessorTask . |
protected Adapter |
adapter
Associated adapter. |
protected Class |
algorithmClass
The Algorithm used to predict the end of the NIO stream |
protected String |
algorithmClassName
The Algorithm used to parse the NIO stream. |
protected boolean |
asyncExecution
Is asynchronous mode enabled? |
protected AsyncHandler |
asyncHandler
When the asynchronous mode is enabled, the execution of this object will be delegated to the AsyncHandler |
protected boolean |
bufferResponse
Buffer the response until the buffer is full. |
protected String |
compressableMimeTypes
|
protected String |
compression
Compression value. |
protected int |
compressionMinSize
|
protected Controller |
controller
The Grizzly's Controller. |
static String |
DEFAULT_ALGORITHM
The default NIO stream algorithm. |
protected static boolean |
defaultAlgorithmInstalled
Is the DEFAULT_ALGORITHM used. |
protected String |
defaultResponseType
The default response-type |
protected boolean |
disableUploadTimeout
Flag to disable setting a different time-out on uploads. |
protected boolean |
displayConfiguration
If true , display the NIO configuration information. |
protected String |
domain
|
protected boolean |
enableNioLogging
Grizzly own debug flag. |
protected FileCacheFactory |
fileCacheFactory
The FileCacheFactory associated with this Selector |
protected String |
forcedRequestType
The forced request-type |
protected RequestGroupInfo |
globalRequestProcessor
Monitoring object used to store information. |
protected ObjectName |
globalRequestProcessorName
|
protected InetAddress |
inet
|
protected boolean |
initialized
|
protected boolean |
isFileCacheEnabled
Is the FileCache enabled. |
protected boolean |
isLargeFileCacheEnabled
Is the large FileCache enabled. |
protected boolean |
isMonitoringEnabled
Is monitoring already started. |
protected KeepAliveCountManager |
keepAliveCounter
Keep-Alive subsystem. |
protected int |
keepAliveThreadCount
|
protected int |
keepAliveTimeoutInSeconds
|
protected int |
linger
|
protected static Logger |
logger
The logger used by the grizzly classes. |
protected int |
maxCacheEntries
The maximum entries in the fileCache |
protected long |
maxEntrySize
The maximum size of a cached resources. |
protected int |
maxHttpHeaderSize
Default HTTP header buffer size. |
protected int |
maxKeepAliveRequests
|
protected long |
maxLargeFileCacheSize
The maximum cached bytes |
protected int |
maxPostSize
|
protected int |
maxQueueSizeInBytes
Maximum pending connection before refusing requests. |
protected long |
maxSmallFileCacheSize
The maximum cached bytes |
protected int |
maxThreads
Maximum number of WorkerThread |
protected long |
minEntrySize
The maximum size of a cached resources. |
protected int |
minWorkerThreads
Minimum numbers of WorkerThread created |
protected MBeanServer |
mserver
|
protected String |
noCompressionUserAgents
|
protected ObjectName |
oname
|
protected boolean |
oOBInline
|
protected String |
pipelineClassName
The default Pipeline used. |
protected PipelineStatistic |
pipelineStat
Placeholder for Pipeline statistic. |
protected int |
port
|
protected PUReadFilter |
portUnificationFilter
Port unification filter |
protected LinkedListPipeline |
processorPipeline
The queue shared by this thread and the code>ProcessorTask. |
protected ConcurrentLinkedQueue<ProcessorTask> |
processorTasks
ConcurrentLinkedQueue used as an object pool. |
protected ObjectName |
processorWorkerThreadName
|
protected HashMap<String,Object> |
properties
Holder for our configured properties. |
protected boolean |
rcmSupport
RCM support |
protected int |
readThreadsCount
The number of SelectorReadThread |
protected boolean |
recycleTasks
Recycle the Task after running them |
protected int |
requestBufferSize
The input request buffer size. |
protected String |
restrictedUserAgents
|
protected static String |
rootFolder
The root folder where application are deployed |
protected boolean |
running
|
protected int |
secondsMaxAge
Timeout before remove the static resource from the cache. |
protected Selector |
selector
The Selector used by the connector. |
protected TCPSelectorHandler |
selectorHandler
SelectorHandler current SelectorThread is
based on |
protected static int |
selectorTimeout
The Selector timeout value. |
static String |
SERVER_NAME
|
protected int |
serverTimeout
|
protected int |
socketTimeout
|
protected int |
ssBackLog
Server socket backlog. |
protected boolean |
tcpNoDelay
|
protected int |
threadsIncrement
The number used when increamenting the Pipeline
thread pool. |
protected int |
threadsTimeout
The timeout used by the thread when processing a request. |
protected int |
uploadTimeout
Maximum timeout on uploads. |
protected boolean |
useByteBufferView
Create view ByteBuffer from another ByteBuffer |
protected boolean |
useDirectByteBuffer
Is the ByteBuffer used by the ReadTask use
direct ByteBuffer or not. |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
SelectorThread()
Create the Selector object. |
Method Summary | |
---|---|
void |
cancelKey(SelectionKey key)
Cancel the current SelectionKey |
protected void |
clearTasks()
Clear all cached Tasks |
protected void |
configureCompression(DefaultProcessorTask processorTask)
|
protected void |
configureFilters(ProtocolChain protocolChain)
Adds and configures ProtocolChain 's filters |
void |
configurePortUnification(List<ProtocolFinder> protocolFinders,
List<ProtocolHandler> protocolHandlers,
List<PUPreProcessor> preProcessors)
Configures port unification depending on passed List s |
void |
configurePortUnification(Properties props)
Configures port unification depending on passed Properties |
protected ProcessorTask |
configureProcessorTask(DefaultProcessorTask task)
|
protected void |
configureSelectorHandler(TCPSelectorHandler selectorHandler)
Configure TCPSelectorHandler |
protected ProtocolFilter |
createHttpParserFilter()
Create HTTP parser ProtocolFilter |
protected ProtocolFilter |
createRaFilter()
Create and configure resource allocation ProtocolFilter |
protected TCPSelectorHandler |
createSelectorHandler()
Create TCPSelectorHandler |
void |
disableMonitoring()
Disable gathering of monitoring datas. |
protected void |
disablePipelineStats()
Removes PipelineStatistic from every
Pipeline , when monitoring has been turned off. |
void |
enableMonitoring()
Enable gathering of monitoring datas. |
protected void |
enablePipelineStats()
Injects PipelineStatistic into every
Pipeline , for monitoring purposes. |
void |
enableRcmSupport(boolean rcmSupport)
Enable Application Resource Allocation Grizzly Extension. |
ConcurrentLinkedQueue<ProcessorTask> |
getActiveProcessorTasks()
|
Adapter |
getAdapter()
Get the associated adapter. |
InetAddress |
getAddress()
|
String |
getAlgorithmClassName()
|
AsyncHandler |
getAsyncHandler()
Return the AsyncHandler used when asynchronous execution is
enabled. |
boolean |
getBufferResponse()
Return true if the reponse is buffered. |
int |
getBufferSize()
Return the request input buffer size |
ClassLoader |
getClassLoader()
|
String |
getCompressableMimeTypes()
|
String |
getCompression()
|
int |
getCompressionMinSize()
|
Controller |
getController()
|
int |
getCurrentBusyProcessorThreads()
Provides the count of request threads that are currently being processed by the container |
String |
getDefaultResponseType()
|
boolean |
getDisableUploadTimeout()
Get the flag that controls upload time-outs. |
String |
getDomain()
|
boolean |
getEnableAsyncExecution()
Return true when asynchronous execution is enabled. |
String |
getForcedRequestType()
|
RequestGroupInfo |
getGlobalRequestProcessor()
|
InetAddress |
getInet()
|
KeepAliveCountManager |
getKeepAliveCounter()
|
KeepAliveStats |
getKeepAliveStats()
|
int |
getKeepAliveThreadCount()
Gets the number of keep-alive threads. |
int |
getKeepAliveTimeoutInSeconds()
Gets the number of seconds before a keep-alive connection that has been idle times out and is closed. |
boolean |
getLargeFileCacheEnabled()
Is the large file cache support enabled. |
int |
getLinger()
|
Management |
getManagement()
|
int |
getMaxCacheEntries()
Return the maximum entries this cache can contains. |
long |
getMaxEntrySize()
Get the maximum size a FileCacheEntry can have. |
int |
getMaxHttpHeaderSize()
|
int |
getMaxKeepAliveRequests()
|
long |
getMaxLargeCacheSize()
Get the maximum cache size |
int |
getMaxPostSize()
|
int |
getMaxQueueSizeInBytes()
|
long |
getMaxSmallCacheSize()
Get the maximum cache size |
int |
getMaxThreads()
|
long |
getMinEntrySize()
Get the maximum size a FileCacheEntry can have. |
int |
getMinWorkerThreads()
|
String |
getNoCompressionUserAgents()
|
ObjectName |
getObjectName()
|
String |
getPipelineClassName()
|
int |
getPort()
|
int |
getPortLowLevel()
Similar to getPort() , but getting port number directly from
connection (ServerSocket , DatagramSocket ). |
Pipeline |
getProcessorPipeline()
|
ProcessorTask |
getProcessorTask()
Return a ProcessorTask from the pool. |
Object |
getProperty(String name)
Return a configured property. |
int |
getQueueSizeInBytes()
Get the maximum pending connection this Pipeline
can handle. |
RequestGroupInfo |
getRequestGroupInfo()
|
String |
getRestrictedUserAgents()
|
boolean |
getReuseAddress()
|
Selector |
getSelector()
|
static SelectorThread |
getSelector(int port)
Return the SelectorThread which listen on port, or null
if there is no SelectorThread . |
int |
getSelectorReadThreadsCount()
|
static Enumeration<SelectorThread> |
getSelectors()
Return an Enumeration of the active
SelectorThread s |
SelectorThreadKeyHandler |
getSelectorThreadKeyHandler()
|
static int |
getSelectorTimeout()
|
int |
getServerTimeout()
|
int |
getSocketTimeout()
|
int |
getSsBackLog()
|
boolean |
getTcpNoDelay()
|
int |
getThreadsIncrement()
|
int |
getUploadTimeout()
Get the upload timeout. |
static String |
getWebAppRootPath()
Return the folder's root where application are deployed. |
protected void |
initAlgorithm()
Load using reflection the Algorithm class. |
protected void |
initController()
Initialize the Grizzly Framework classes. |
void |
initEndpoint()
initialized the endpoint by creating the ServerScoketChannel
and by initializing the server socket. |
protected void |
initFileCacheFactory()
Initialize the fileCacheFactory associated with this instance |
protected void |
initKeepAliveCounter()
Initialize the keep-alive mechanism. |
protected void |
initMonitoringLevel()
|
protected void |
initPipeline()
Init the Pipeline s used by the WorkerThread s. |
protected void |
initProcessorTask(int size)
Create a pool of ProcessorTask |
boolean |
isEnableNioLogging()
|
boolean |
isFileCacheEnabled()
Is the fileCache enabled. |
boolean |
isMonitoringEnabled()
Returns true if monitoring has been enabled,
false otherwise. |
boolean |
isRcmSupported()
Returns whether Application Resource Allocation Grizzly Extension is supported |
boolean |
isRunning()
|
boolean |
isUseByteBufferView()
|
boolean |
isUseDirectByteBuffer()
|
void |
listen()
Start the SelectorThread using its own thread and don't block the Thread. |
static Logger |
logger()
Return the logger used by the Grizzly classes. |
protected LinkedListPipeline |
newPipeline(int maxThreads,
int minThreads,
String name,
int port,
int priority)
Create a new Pipeline instance using the
pipelineClassName value. |
protected ProcessorTask |
newProcessorTask(boolean initialize)
Create ProcessorTask objects and configure it to be ready
to proceed request. |
void |
postDeregister()
|
void |
postRegister(Boolean registrationDone)
|
void |
preDeregister()
|
ObjectName |
preRegister(MBeanServer server,
ObjectName name)
|
protected void |
rampUpProcessorTask()
Initialize ProcessorTask |
protected void |
reconfigureAsyncExecution()
Reconfigure Grizzly Asynchronous Request Processing(ARP) internal objects. |
protected void |
registerComponents()
Register JMX components. |
void |
registerKey(SelectionKey key)
Register a SelectionKey to this Selector
running of this thread. |
void |
removeCacheEntry(String contextPath)
Remove a context path from the FileCache . |
void |
removeProperty(String name)
remove a configured property. |
void |
returnTask(Task task)
Returns the Task object to the pool. |
void |
run()
Start the endpoint (this) |
void |
setAdapter(Adapter adapter)
Set the associated adapter. |
void |
setAddress(InetAddress inet)
|
void |
setAlgorithmClassName(String algorithmClassName)
|
void |
setAsyncHandler(AsyncHandler asyncHandler)
Set the AsyncHandler used when asynchronous execution is
enabled. |
void |
setBufferResponse(boolean bufferResponse)
true if the reponse willk be buffered. |
void |
setBufferSize(int requestBufferSize)
Set the request input buffer size |
void |
setClassLoader(ClassLoader classLoader)
Set the ClassLoader used to load configurable
classes (Pipeline, StreamAlgorithm). |
void |
setCompressableMimeTypes(String compressableMimeTypes)
|
void |
setCompression(String compression)
|
void |
setCompressionMinSize(int compressionMinSize)
|
void |
setController(Controller controller)
|
void |
setDefaultResponseType(String defaultResponseType)
|
void |
setDisableUploadTimeout(boolean isDisabled)
Set the flag to control upload time-outs. |
void |
setDisplayConfiguration(boolean displayConfiguration)
|
void |
setEnableAsyncExecution(boolean asyncExecution)
Enable the AsyncHandler used when asynchronous |
void |
setEnableNioLogging(boolean enableNioLogging)
|
void |
setFileCacheIsEnabled(boolean isFileCacheEnabled)
Is the file caching mechanism enabled. |
void |
setForcedRequestType(String forcedRequestType)
|
void |
setInet(InetAddress inet)
|
void |
setKeepAliveThreadCount(int threadCount)
Sets the number of keep-alive threads. |
void |
setKeepAliveTimeoutInSeconds(int timeout)
Sets the number of seconds before a keep-alive connection that has been idle times out and is closed. |
void |
setLargeFileCacheEnabled(boolean isLargeEnabled)
Is the large file cache support enabled. |
void |
setLinger(int i)
|
static void |
setLogger(Logger l)
Set the logger used by this instance. |
void |
setManagement(Management jmxManagement)
|
void |
setMaxCacheEntries(int mEntries)
Set the maximum entries this cache can contains. |
void |
setMaxEntrySize(long mEntrySize)
Set the maximum size a FileCacheEntry can have. |
void |
setMaxHttpHeaderSize(int maxHttpHeaderSize)
|
void |
setMaxKeepAliveRequests(int mkar)
Set the maximum number of Keep-Alive requests that we will honor. |
void |
setMaxLargeCacheSize(long mCacheSize)
Set the maximum cache size |
void |
setMaxPostSize(int maxPostSize)
|
void |
setMaxQueueSizeInBytes(int maxQueueSizeInBytes)
|
void |
setMaxSmallCacheSize(long mCacheSize)
Set the maximum cache size |
void |
setMaxThreads(int maxThreads)
|
void |
setMinEntrySize(long mSize)
Set the maximum size a FileCacheEntry can have. |
void |
setMinThreads(int minWorkerThreads)
The minimun threads created at startup. |
void |
setMinWorkerThreads(int minWorkerThreads)
|
void |
setNoCompressionUserAgents(String noCompressionUserAgents)
|
void |
setPipelineClassName(String pipelineClassName)
|
void |
setPort(int port)
|
void |
setProperty(String name,
Object value)
Set a configured property. |
void |
setRestrictedUserAgents(String restrictedUserAgents)
|
void |
setReuseAddress(boolean reuseAddress)
|
void |
setSecondsMaxAge(int sMaxAges)
The timeout in seconds before remove a FileCacheEntry
from the fileCache |
void |
setSelectorReadThreadsCount(int readThreadsCount)
|
static void |
setSelectorTimeout(int aSelectorTimeout)
|
void |
setServerTimeout(int timeout)
Sets the timeout in ms of the server sockets created by this server. |
protected void |
setSocketOptions(Socket socket)
|
void |
setSocketTimeout(int socketTimeout)
|
void |
setSsBackLog(int ssBackLog)
|
void |
setTcpNoDelay(boolean b)
|
void |
setThreadsIncrement(int threadsIncrement)
|
void |
setUploadTimeout(int uploadTimeout)
Set the upload timeout. |
void |
setUseByteBufferView(boolean useByteBufferView)
|
void |
setUseDirectByteBuffer(boolean useDirectByteBuffer)
|
static void |
setWebAppRootPath(String rf)
Set the document root folder |
void |
startEndpoint()
Start the Acceptor Thread and wait for incoming connection, in a non blocking mode. |
protected void |
startListener()
Start a non blocking Selector object. |
protected void |
startPipelines()
Starts the Pipeline used by this Selector |
void |
stopEndpoint()
|
protected void |
stopPipelines()
Stop the Pipeline used by this Selector |
protected void |
unregisterComponents()
Unregister components. |
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 |
Field Detail |
---|
public static final String SERVER_NAME
protected int serverTimeout
protected InetAddress inet
protected int port
protected boolean initialized
protected volatile boolean running
protected String domain
protected ObjectName oname
protected ObjectName globalRequestProcessorName
protected MBeanServer mserver
protected ObjectName processorWorkerThreadName
protected boolean tcpNoDelay
protected int linger
protected int socketTimeout
protected int maxKeepAliveRequests
protected int keepAliveThreadCount
protected String compression
protected String noCompressionUserAgents
protected String restrictedUserAgents
protected String compressableMimeTypes
protected int compressionMinSize
protected boolean bufferResponse
protected int maxHttpHeaderSize
protected int maxPostSize
protected Selector selector
Selector
used by the connector.
protected TCPSelectorHandler selectorHandler
SelectorHandler
current SelectorThread
is
based on
protected Adapter adapter
protected LinkedListPipeline processorPipeline
protected PipelineStatistic pipelineStat
Pipeline
statistic.
protected String pipelineClassName
Pipeline
used.
protected int maxThreads
WorkerThread
protected int minWorkerThreads
WorkerThread
created
protected int threadsIncrement
Pipeline
thread pool.
protected int threadsTimeout
protected boolean useDirectByteBuffer
ByteBuffer
used by the ReadTask
use
direct ByteBuffer
or not.
protected RequestGroupInfo globalRequestProcessor
protected boolean displayConfiguration
true
, display the NIO configuration information.
protected boolean isMonitoringEnabled
protected int requestBufferSize
protected boolean useByteBufferView
ByteBuffer
from another ByteBuffer
protected int keepAliveTimeoutInSeconds
protected boolean recycleTasks
Task
after running them
protected static int selectorTimeout
Selector
timeout value. By default, it is set to 60000
miliseconds (as in the j2se 1.5 ORB).
protected int maxQueueSizeInBytes
protected Class algorithmClass
Algorithm
used to predict the end of the NIO stream
protected String algorithmClassName
Algorithm
used to parse the NIO stream.
public static final String DEFAULT_ALGORITHM
protected int ssBackLog
protected String defaultResponseType
protected String forcedRequestType
protected static String rootFolder
protected Controller controller
protected boolean rcmSupport
protected PUReadFilter portUnificationFilter
protected boolean oOBInline
protected HashMap<String,Object> properties
protected ConcurrentLinkedQueue<ProcessorTask> processorTasks
ConcurrentLinkedQueue
used as an object pool.
If the list becomes empty, new ProcessorTask
will be
automatically added to the list.
protected ConcurrentLinkedQueue<ProcessorTask> activeProcessorTasks
ProcessorTask
.
protected int readThreadsCount
SelectorReadThread
protected static Logger logger
protected boolean disableUploadTimeout
protected int uploadTimeout
protected KeepAliveCountManager keepAliveCounter
SelectionKey
will stay forever in the
Selector
keys, and this will eventualy produce a
memory leak.
protected FileCacheFactory fileCacheFactory
protected int secondsMaxAge
protected int maxCacheEntries
fileCache
protected long minEntrySize
protected long maxEntrySize
protected long maxLargeFileCacheSize
protected long maxSmallFileCacheSize
protected boolean isFileCacheEnabled
protected boolean isLargeFileCacheEnabled
protected boolean asyncExecution
protected AsyncHandler asyncHandler
AsyncHandler
protected static boolean defaultAlgorithmInstalled
protected boolean enableNioLogging
Constructor Detail |
---|
public SelectorThread()
Selector
object. Each instance of this class
will listen to a specific port.
Method Detail |
---|
public static final SelectorThread getSelector(int port)
SelectorThread
which listen on port, or null
if there is no SelectorThread
.
public static final Enumeration<SelectorThread> getSelectors()
Enumeration
of the active
SelectorThread
s
public void registerKey(SelectionKey key)
SelectionKey
to this Selector
running of this thread.
protected void initController()
protected TCPSelectorHandler createSelectorHandler()
TCPSelectorHandler
protected void configureSelectorHandler(TCPSelectorHandler selectorHandler)
TCPSelectorHandler
protected ProtocolFilter createRaFilter()
ProtocolFilter
ProtocolFilter
protected ProtocolFilter createHttpParserFilter()
ProtocolFilter
ProtocolFilter
protected void configureFilters(ProtocolChain protocolChain)
ProtocolChain
's filters
ProtocolChain
- to configurepublic void configurePortUnification(Properties props)
Properties
props
- Properties
. If props is null - port unification
will be configured from System propertiespublic void configurePortUnification(List<ProtocolFinder> protocolFinders, List<ProtocolHandler> protocolHandlers, List<PUPreProcessor> preProcessors)
List
s
protocolFinders
- ProtocolFinder
sprotocolHandlers
- ProtocolHandler
spreProcessors
- PUPreProcessor
sprotected LinkedListPipeline newPipeline(int maxThreads, int minThreads, String name, int port, int priority)
Pipeline
instance using the
pipelineClassName
value.
protected void initFileCacheFactory()
protected void enablePipelineStats()
PipelineStatistic
into every
Pipeline
, for monitoring purposes.
protected void disablePipelineStats()
PipelineStatistic
from every
Pipeline
, when monitoring has been turned off.
protected void initAlgorithm()
Algorithm
class.
protected void initKeepAliveCounter()
protected void initPipeline()
Pipeline
s used by the WorkerThread
s.
protected void initProcessorTask(int size)
ProcessorTask
protected void rampUpProcessorTask()
ProcessorTask
protected ProcessorTask newProcessorTask(boolean initialize)
ProcessorTask
objects and configure it to be ready
to proceed request.
protected ProcessorTask configureProcessorTask(DefaultProcessorTask task)
protected void reconfigureAsyncExecution()
public ProcessorTask getProcessorTask()
ProcessorTask
from the pool. If the pool is empty,
create a new instance.
public void run()
run
in interface Runnable
run
in class Thread
public void initEndpoint() throws IOException, InstantiationException
ServerScoketChannel
and by initializing the server socket.
IOException
InstantiationException
public void stopEndpoint()
public void startEndpoint() throws IOException, InstantiationException
IOException
InstantiationException
public void listen() throws IOException, InstantiationException
IOException
InstantiationException
protected void startPipelines()
Pipeline
used by this Selector
protected void stopPipelines()
Pipeline
used by this Selector
protected void startListener()
Selector
object.
public void cancelKey(SelectionKey key)
SelectionKey
public void returnTask(Task task)
Task
object to the pool.
protected void clearTasks()
Tasks
public void setMaxThreads(int maxThreads)
public int getMaxThreads()
public int getPortLowLevel()
getPort()
, but getting port number directly from
connection (ServerSocket
, DatagramSocket
).
So if default port number 0 was set during initialization, then getPort()
will return 0, but getPortLowLevel() will return port number assigned by OS.
SelectorThread
was not startedpublic int getPort()
public void setPort(int port)
public InetAddress getAddress()
public void setAddress(InetAddress inet)
public boolean isRunning()
public int getCurrentBusyProcessorThreads()
public void setServerTimeout(int timeout)
By default this value is 1000ms.
public boolean getTcpNoDelay()
public void setTcpNoDelay(boolean b)
public int getLinger()
public void setLinger(int i)
public int getServerTimeout()
public InetAddress getInet()
public void setInet(InetAddress inet)
public int getSocketTimeout()
public void setSocketTimeout(int socketTimeout)
public int getQueueSizeInBytes()
Pipeline
can handle.
public int getMaxKeepAliveRequests()
public void setMaxKeepAliveRequests(int mkar)
public void setKeepAliveTimeoutInSeconds(int timeout)
timeout
- Keep-alive timeout in number of secondspublic int getKeepAliveTimeoutInSeconds()
public int getKeepAliveThreadCount()
public void setKeepAliveThreadCount(int threadCount)
threadCount
- Number of keep-alive threadspublic void setAdapter(Adapter adapter)
adapter
- the new adapterpublic Adapter getAdapter()
protected void setSocketOptions(Socket socket)
public ObjectName getObjectName()
public String getDomain()
public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
preRegister
in interface MBeanRegistration
Exception
public void postRegister(Boolean registrationDone)
postRegister
in interface MBeanRegistration
public void preDeregister() throws Exception
preDeregister
in interface MBeanRegistration
Exception
public void postDeregister()
postDeregister
in interface MBeanRegistration
protected void registerComponents()
protected void unregisterComponents()
public Management getManagement()
public void setManagement(Management jmxManagement)
public void enableMonitoring()
public void disableMonitoring()
public boolean isMonitoringEnabled()
true
if monitoring has been enabled,
false
otherwise.
public RequestGroupInfo getRequestGroupInfo()
public KeepAliveStats getKeepAliveStats()
protected void initMonitoringLevel()
public int getMaxHttpHeaderSize()
public void setMaxHttpHeaderSize(int maxHttpHeaderSize)
public void setMinThreads(int minWorkerThreads)
public void setBufferSize(int requestBufferSize)
public int getBufferSize()
public Selector getSelector()
public Controller getController()
public void setController(Controller controller)
public void removeCacheEntry(String contextPath)
FileCache
.
public void setSecondsMaxAge(int sMaxAges)
FileCacheEntry
from the fileCache
public void setMaxCacheEntries(int mEntries)
public int getMaxCacheEntries()
public void setMinEntrySize(long mSize)
FileCacheEntry
can have.
public long getMinEntrySize()
FileCacheEntry
can have.
public void setMaxEntrySize(long mEntrySize)
FileCacheEntry
can have.
public long getMaxEntrySize()
FileCacheEntry
can have.
public void setMaxLargeCacheSize(long mCacheSize)
public long getMaxLargeCacheSize()
public void setMaxSmallCacheSize(long mCacheSize)
public long getMaxSmallCacheSize()
public boolean isFileCacheEnabled()
public void setFileCacheIsEnabled(boolean isFileCacheEnabled)
public void setLargeFileCacheEnabled(boolean isLargeEnabled)
public boolean getLargeFileCacheEnabled()
public void setEnableAsyncExecution(boolean asyncExecution)
AsyncHandler
used when asynchronous
public boolean getEnableAsyncExecution()
public void setAsyncHandler(AsyncHandler asyncHandler)
AsyncHandler
used when asynchronous execution is
enabled.
public AsyncHandler getAsyncHandler()
AsyncHandler
used when asynchronous execution is
enabled.
public static void setLogger(Logger l)
public static Logger logger()
public static void setWebAppRootPath(String rf)
public static String getWebAppRootPath()
public boolean getBufferResponse()
true
if the reponse is buffered.
public void setBufferResponse(boolean bufferResponse)
true
if the reponse willk be buffered.
public void enableRcmSupport(boolean rcmSupport)
public boolean isRcmSupported()
public KeepAliveCountManager getKeepAliveCounter()
protected void configureCompression(DefaultProcessorTask processorTask)
public String getCompression()
public void setCompression(String compression)
public String getNoCompressionUserAgents()
public void setNoCompressionUserAgents(String noCompressionUserAgents)
public String getRestrictedUserAgents()
public void setRestrictedUserAgents(String restrictedUserAgents)
public String getCompressableMimeTypes()
public void setCompressableMimeTypes(String compressableMimeTypes)
public int getCompressionMinSize()
public void setCompressionMinSize(int compressionMinSize)
public int getSelectorReadThreadsCount()
public void setSelectorReadThreadsCount(int readThreadsCount)
public Pipeline getProcessorPipeline()
public String getPipelineClassName()
public void setPipelineClassName(String pipelineClassName)
public int getMinWorkerThreads()
public void setMinWorkerThreads(int minWorkerThreads)
public int getThreadsIncrement()
public void setThreadsIncrement(int threadsIncrement)
public boolean isUseDirectByteBuffer()
public void setUseDirectByteBuffer(boolean useDirectByteBuffer)
public RequestGroupInfo getGlobalRequestProcessor()
public void setDisplayConfiguration(boolean displayConfiguration)
public boolean isUseByteBufferView()
public void setUseByteBufferView(boolean useByteBufferView)
public static int getSelectorTimeout()
public static void setSelectorTimeout(int aSelectorTimeout)
public int getMaxQueueSizeInBytes()
public void setMaxQueueSizeInBytes(int maxQueueSizeInBytes)
public String getAlgorithmClassName()
public void setAlgorithmClassName(String algorithmClassName)
public int getSsBackLog()
public void setSsBackLog(int ssBackLog)
public String getDefaultResponseType()
public void setDefaultResponseType(String defaultResponseType)
public String getForcedRequestType()
public void setForcedRequestType(String forcedRequestType)
public ConcurrentLinkedQueue<ProcessorTask> getActiveProcessorTasks()
public ClassLoader getClassLoader()
public void setClassLoader(ClassLoader classLoader)
ClassLoader
used to load configurable
classes (Pipeline, StreamAlgorithm).
public boolean isEnableNioLogging()
public void setEnableNioLogging(boolean enableNioLogging)
public int getMaxPostSize()
public void setMaxPostSize(int maxPostSize)
public void setReuseAddress(boolean reuseAddress)
public boolean getReuseAddress()
public SelectorThreadKeyHandler getSelectorThreadKeyHandler()
public void setDisableUploadTimeout(boolean isDisabled)
public boolean getDisableUploadTimeout()
public void setUploadTimeout(int uploadTimeout)
public int getUploadTimeout()
public Object getProperty(String name)
public void setProperty(String name, Object value)
public void removeProperty(String name)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |