com.sun.enterprise.web.connector.grizzly
Class WorkerThreadImpl

java.lang.Object
  extended by java.lang.Thread
      extended by com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl
All Implemented Interfaces:
WorkerThread, Runnable
Direct Known Subclasses:
SSLWorkerThread

public class WorkerThreadImpl
extends Thread
implements WorkerThread

Simple worker thread used for processing HTTP requests. All threads are synchronized using a Pipeline object

Author:
Jean-Francois Arcand

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
protected  ByteBuffer byteBuffer
          The ByteBuffer used when Task are executed.
protected  boolean doTask
          Looing variable.
protected  Pipeline pipeline
          The Pipeline on which this thread synchronize.
protected  Runnable target
          What will be run.
protected static ThreadGroup threadGroup
          The ThreadGroup used.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
WorkerThreadImpl(Pipeline pipeline, String name)
          Create a Thread that will synchronizes/block on Pipeline instance.
WorkerThreadImpl(ThreadGroup threadGroup, Runnable runnable)
          Create a Thread that will synchronizes/block on Pipeline instance.
 
Method Summary
 ByteBuffer getByteBuffer()
          Return the ByteBuffer shared this thread
 void run()
          Execute a Task.
 void setByteBuffer(ByteBuffer byteBuffer)
          Set the ByteBuffer shared this thread
 void terminate()
          Stop this thread.
 
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, 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
 

Field Detail

target

protected Runnable target
What will be run.


byteBuffer

protected ByteBuffer byteBuffer
The ByteBuffer used when Task are executed.


pipeline

protected Pipeline pipeline
The Pipeline on which this thread synchronize.


doTask

protected volatile boolean doTask
Looing variable.


threadGroup

protected static final ThreadGroup threadGroup
The ThreadGroup used.

Constructor Detail

WorkerThreadImpl

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


WorkerThreadImpl

public WorkerThreadImpl(Pipeline pipeline,
                        String name)
Create a Thread that will synchronizes/block on Pipeline instance.

Method Detail

run

public void run()
Execute a Task.

Specified by:
run in interface Runnable
Overrides:
run in class Thread

terminate

public void terminate()
Stop this thread. If this Thread is performing atask, the task will be completed.


setByteBuffer

public void setByteBuffer(ByteBuffer byteBuffer)
Set the ByteBuffer shared this thread

Specified by:
setByteBuffer in interface WorkerThread

getByteBuffer

public ByteBuffer getByteBuffer()
Return the ByteBuffer shared this thread

Specified by:
getByteBuffer in interface WorkerThread


Copyright © 2005-2015 Oracle Corporation. All Rights Reserved.