|
||||||||||
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
|
Nested classes/interfaces inherited from class com.sun.grizzly.util.SelectionKeyAttachment |
---|
SelectionKeyAttachment.KeySelectionListener, SelectionKeyAttachment.TimeOutListener |
Field Summary |
---|
Fields inherited from class com.sun.grizzly.util.SelectionKeyAttachment |
---|
DEREGISTERED, idleTimeoutDelay, keySelectionListener, timeout, timeoutListener, 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()
Returns the idle timeout delay. |
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. |
long |
getTransactionTimeout()
Return the time, in milliseconds, this object can be attached to a Thread |
protected static boolean |
isUnlimitedTimeout(long timeout)
|
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 idleTimeoutDelay)
Set the idle timeout delay. |
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. |
void |
setTransactionTimeout(long transactionTimeout)
Set the time, in milliseconds, this object can be attached to a Thread |
String |
toString()
|
Methods inherited from class com.sun.grizzly.util.SelectionKeyAttachment |
---|
getAttachment, getKeySelectionListener, getTimeout, getTimeoutListener, handleSelectedKey, setKeySelectionListener, setTimeout, setTimeoutListener, 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 AttributeHolder
key
- - name of an attributevalue
- - value of named attributepublic Object getAttribute(String key)
AttributeHolder
getAttribute
in interface AttributeHolder
key
- - name of an attribute
public Object removeAttribute(String key)
AttributeHolder
removeAttribute
in interface AttributeHolder
key
- - name of an attribute
public void setAttributes(Map<String,Object> attributes)
AttributeHolder
Map
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 AttributeHolder
attributes
- - map of name/value pairspublic Map<String,Object> getAttributes()
AttributeHolder
Map
of attribute name/value pairs.
Updates, performed on the returned Map
will be reflected in
this AttributeHolder
getAttributes
in interface AttributeHolder
Map
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.
ByteBuffer
public void setInputBB(ByteBuffer inputBB)
ByteBuffer
used to handle request.
inputBB
- ByteBuffer
public ByteBuffer getOutputBB()
ByteBuffer
used to handle response.
ByteBuffer
public void setOutputBB(ByteBuffer outputBB)
ByteBuffer
used to handle response.
outputBB
- ByteBuffer
public 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 SelectionKeyActionAttachment
selectionKey
- public void postProcess(SelectionKey selectionKey)
postProcess
in class SelectionKeyActionAttachment
selectionKey
- public void reset()
public void release(SelectionKey selectionKey)
release
in class SelectionKeyAttachment
public String toString()
toString
in class Object
public Thread activeThread()
Thread
which is executing this object.
Thread
which is executing this object.public long getTransactionTimeout()
Thread
Thread
public void setTransactionTimeout(long transactionTimeout)
Thread
transactionTimeout
- the time, in milliseconds, this object can be attached to a Thread
public void setIdleTimeoutDelay(long idleTimeoutDelay)
SelectionKeyAttachment
setIdleTimeoutDelay
in class SelectionKeyAttachment
public long getIdleTimeoutDelay()
SelectionKeyAttachment
getIdleTimeoutDelay
in class SelectionKeyAttachment
protected static final boolean isUnlimitedTimeout(long timeout)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |