com.sun.grizzly.http
Class HttpWorkerThread

java.lang.Object
  extended by java.lang.Thread
      extended by com.sun.grizzly.util.WorkerThread
          extended by com.sun.grizzly.util.WorkerThreadImpl
              extended by com.sun.grizzly.http.HttpWorkerThread
All Implemented Interfaces:
Runnable

public class HttpWorkerThread
extends WorkerThreadImpl

Specialized WorkerThread.

Author:
Jeanfrancois Arcand

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class com.sun.grizzly.util.WorkerThreadImpl
DEFAULT_BYTE_BUFFER_SIZE, DEFAULT_BYTEBUFFER_TYPE, threadAttachment
 
Fields inherited from class com.sun.grizzly.util.WorkerThread
byteBuffer, inputBB, outputBB, sslEngine
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
HttpWorkerThread(ExecutorService threadPool, String name)
          Create a Thread that will synchronizes/block on ExecutorService instance.
HttpWorkerThread(ExecutorService threadPool, String name, Runnable runnable, int initialByteBufferSize)
          Create a Thread
HttpWorkerThread(ThreadGroup threadGroup, Runnable runnable)
          Create a Thread that will synchronizes/block on ExecutorService instance.
 
Method Summary
 ThreadAttachment getAttachment()
          Get the current set of attributes (state) associated with this instance.
 InputReader getInputStream()
           
 ProcessorTask getProcessorTask()
           
 StreamAlgorithm getStreamAlgorithm()
           
 void reset()
           
 void setInputStream(InputReader inputStream)
           
 void setProcessorTask(ProcessorTask processorTask)
           
 void setStreamAlgorithm(StreamAlgorithm streamAlgorithm)
           
 
Methods inherited from class com.sun.grizzly.util.WorkerThreadImpl
attach, createByteBuffer, detach, getByteBufferType, getContext, getInitialByteBufferSize, getPendingIOhandler, processTask, setByteBufferType, setContext, setInitialByteBufferSize, setPendingIOhandler, updateAttachment
 
Methods inherited from class com.sun.grizzly.util.WorkerThread
getByteBuffer, getInputBB, getOutputBB, getSSLEngine, setByteBuffer, setInputBB, setOutputBB, setSSLEngine
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, 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, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HttpWorkerThread

public HttpWorkerThread(ThreadGroup threadGroup,
                        Runnable runnable)
Create a Thread that will synchronizes/block on ExecutorService instance.

Parameters:
threadGroup - ThreadGroup
runnable - Runnable

HttpWorkerThread

public HttpWorkerThread(ExecutorService threadPool,
                        String name)
Create a Thread that will synchronizes/block on ExecutorService instance.

Parameters:
threadPool - ExecutorService
name - String

HttpWorkerThread

public HttpWorkerThread(ExecutorService threadPool,
                        String name,
                        Runnable runnable,
                        int initialByteBufferSize)
Create a Thread

Parameters:
threadPool - ExecutorService instance
name - thread name
runnable - task to execute
initialByteBufferSize - initial size of thread associated ByteBuffer
Method Detail

getStreamAlgorithm

public StreamAlgorithm getStreamAlgorithm()

setStreamAlgorithm

public void setStreamAlgorithm(StreamAlgorithm streamAlgorithm)

getInputStream

public InputReader getInputStream()

setInputStream

public void setInputStream(InputReader inputStream)

getProcessorTask

public ProcessorTask getProcessorTask()

setProcessorTask

public void setProcessorTask(ProcessorTask processorTask)

getAttachment

public ThreadAttachment getAttachment()
Description copied from class: WorkerThread
Get the current set of attributes (state) associated with this instance. Unlike detach(), this method doesn't clear the WorkerThread attributes.

Overrides:
getAttachment in class WorkerThreadImpl
Returns:
the Thread associated ThreadAttachment

reset

public void reset()
Overrides:
reset in class WorkerThreadImpl


Copyright © 2013 Oracle Corporation. All Rights Reserved.