com.sun.grizzly.http
Class KeepAliveThreadAttachment
java.lang.Object
com.sun.grizzly.util.SelectionKeyAttachment
com.sun.grizzly.util.SelectionKeyActionAttachment
com.sun.grizzly.util.ThreadAttachment
com.sun.grizzly.http.KeepAliveThreadAttachment
- All Implemented Interfaces:
- AttributeHolder
public class KeepAliveThreadAttachment
- extends ThreadAttachment
Add keep alive counting mechanism to the ThreadAttachment
.
- Author:
- Jeanfrancois Arcand
Methods inherited from class com.sun.grizzly.util.ThreadAttachment |
activeThread, associate, deassociate, getAttribute, getAttributes, getByteBuffer, getIdleTimeoutDelay, getInputBB, getMode, getOutputBB, getSSLEngine, getThreadId, getTransactionTimeout, isUnlimitedTimeout, postProcess, process, removeAttribute, reset, setAttribute, setAttributes, setByteBuffer, setIdleTimeoutDelay, setInputBB, setMode, setOutputBB, setSSLEngine, setThreadId, setTransactionTimeout, toString |
logger
protected static final Logger logger
KeepAliveThreadAttachment
public KeepAliveThreadAttachment()
setKeepAliveStats
public void setKeepAliveStats(KeepAliveStats keepAliveStats)
- Set the
KeepAliveStats
instance used to collect request statistic.
- Parameters:
keepAliveStats
- the KeepAliveStats
instance used to collect
request statistic.
increaseKeepAliveCount
public int increaseKeepAliveCount()
- Increase the keep alive count by one.
resetKeepAliveCount
public void resetKeepAliveCount()
- Reset the keep alive value to 0.
getKeepAliveCount
public int getKeepAliveCount()
release
public void release(SelectionKey selectionKey)
- Overrides:
release
in class ThreadAttachment
timedOut
public boolean timedOut(SelectionKey selectionKey)
- Description copied from class:
SelectionKeyAttachment
- called when idle timeout detected.
return true if key should be canceled.
- Overrides:
timedOut
in class SelectionKeyAttachment
- Returns:
Copyright © 2012 Oracle Corporation. All Rights Reserved.