|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.grizzly.util.SelectionKeyAttachment
com.sun.grizzly.util.SelectionKeyActionAttachment
com.sun.grizzly.util.ThreadAttachment
public class ThreadAttachment
This object represent the state of a WorkerThread. This include
the ByteBuffer binded to the WorkerThread, application data etc.
| Nested Class Summary | |
|---|---|
static class |
ThreadAttachment.Mode
|
| Field Summary |
|---|
| Fields inherited from class com.sun.grizzly.util.SelectionKeyAttachment |
|---|
DEREGISTERED, timeout, UNLIMITED_TIMEOUT |
| Constructor Summary | |
|---|---|
ThreadAttachment()
|
|
| Method Summary | |
|---|---|
Thread |
activeThread()
Return the current Thread which is executing this object. |
void |
associate()
Associates ThreadAttachment with the current thread |
void |
deassociate()
Releases ThreadAttachment association with the current thread |
Object |
getAttribute(String key)
Return an object based on a name. |
Map<String,Object> |
getAttributes()
Return a Map of attribute name/value pairs. |
ByteBuffer |
getByteBuffer()
Return the ByteBuffer shared this thread |
long |
getIdleTimeoutDelay()
Return the time, in milliseconds, this object can be attached to a Thread |
ByteBuffer |
getInputBB()
Return the encrypted ByteBuffer used to handle request. |
int |
getMode()
|
ByteBuffer |
getOutputBB()
Return the encrypted ByteBuffer used to handle response. |
SSLEngine |
getSSLEngine()
Set the SSLEngine. |
String |
getThreadId()
Return the name of the Thread on which this instance is binded. |
void |
postProcess(SelectionKey selectionKey)
SelectionKey attachment postProcessing |
void |
process(SelectionKey selectionKey)
SelectionKey attachment processing |
void |
release(SelectionKey selectionKey)
|
Object |
removeAttribute(String key)
Remove a name/value object. |
void |
reset()
|
void |
setAttribute(String key,
Object value)
Set a name/value object. |
void |
setAttributes(Map<String,Object> attributes)
Set a Map of attribute name/value pairs. |
void |
setByteBuffer(ByteBuffer byteBuffer)
Set the ByteBuffer shared this thread |
void |
setIdleTimeoutDelay(long activeThreadTimeout)
Set the time, in milliseconds, this object can be attached to a Thread |
void |
setInputBB(ByteBuffer inputBB)
Set the encrypted ByteBuffer used to handle request. |
void |
setMode(int mode)
|
void |
setOutputBB(ByteBuffer outputBB)
Set the encrypted ByteBuffer used to handle response. |
void |
setSSLEngine(SSLEngine sslEngine)
Get the SSLEngine. |
void |
setThreadId(String threadName)
Set the Thread's name on which this instance is binded. |
String |
toString()
|
| Methods inherited from class com.sun.grizzly.util.SelectionKeyAttachment |
|---|
getAttachment, getTimeout, setTimeout, timedOut |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ThreadAttachment()
| Method Detail |
|---|
public int getMode()
public void setMode(int mode)
public void setAttribute(String key,
Object value)
AttributeHolder
setAttribute in interface AttributeHolderkey - - name of an attributevalue - - value of named attributepublic Object getAttribute(String key)
AttributeHolder
getAttribute in interface AttributeHolderkey - - name of an attribute
public Object removeAttribute(String key)
AttributeHolder
removeAttribute in interface AttributeHolderkey - - name of an attribute
public void setAttributes(Map<String,Object> attributes)
AttributeHolderMap of attribute name/value pairs.
Old AttributeHolder values will not be available.
Later changes of this Map will lead to changes to the current
AttributeHolder.
setAttributes in interface AttributeHolderattributes - - map of name/value pairspublic Map<String,Object> getAttributes()
AttributeHolderMap of attribute name/value pairs.
Updates, performed on the returned Map will be reflected in
this AttributeHolder
getAttributes in interface AttributeHolderMap of attribute name/value pairspublic void setByteBuffer(ByteBuffer byteBuffer)
ByteBuffer shared this thread
public ByteBuffer getByteBuffer()
ByteBuffer shared this thread
public ByteBuffer getInputBB()
ByteBuffer used to handle request.
ByteBufferpublic void setInputBB(ByteBuffer inputBB)
ByteBuffer used to handle request.
inputBB - ByteBufferpublic ByteBuffer getOutputBB()
ByteBuffer used to handle response.
ByteBufferpublic void setOutputBB(ByteBuffer outputBB)
ByteBuffer used to handle response.
outputBB - ByteBufferpublic SSLEngine getSSLEngine()
SSLEngine.
public void setSSLEngine(SSLEngine sslEngine)
SSLEngine.
sslEngine{@link - SSLEngine}public String getThreadId()
public void setThreadId(String threadName)
public void associate()
public void deassociate()
public void process(SelectionKey selectionKey)
process in class SelectionKeyActionAttachmentselectionKey - public void postProcess(SelectionKey selectionKey)
postProcess in class SelectionKeyActionAttachmentselectionKey - public void reset()
public void release(SelectionKey selectionKey)
release in class SelectionKeyAttachmentpublic String toString()
toString in class Objectpublic Thread activeThread()
Thread which is executing this object.
Thread which is executing this object.public void setIdleTimeoutDelay(long activeThreadTimeout)
Thread
setIdleTimeoutDelay in class SelectionKeyAttachmentthe - time, in milliseconds, this object can be attached to a Threadpublic long getIdleTimeoutDelay()
Thread
getIdleTimeoutDelay in class SelectionKeyAttachmentThread
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||