Interface Session
- 
- All Superinterfaces:
- Runnable
 - All Known Implementing Classes:
- AbstractSession,- MultiTaskSession,- SingleTaskSession
 
 public interface Session extends Runnable Requests that arrive through theUnifiedHandlerare all processed within aSessionimplementation. A session accepts aSessionTaskas the work it is meant to perform and those tasks are constructed from incoming requests. A session may be as short-lived as processing a single task before exiting, as with theSingleTaskSessionor may be longer-lived by handling multiple tasks, as with theMultiTaskSession.
- 
- 
Field SummaryFields Modifier and Type Field Description static com.codahale.metrics.TimerevalOpTimerstatic com.codahale.metrics.TimertraversalOpTimer
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetSessionId()Gets the identifier for the session.booleanisAcceptingTasks()Determines if this session can accept additional tasks or not.booleanisBoundTo(io.netty.channel.Channel channel)Determines if the suppliedChannelobject is the same as the one bound to theSession.voidsetSessionCancelFuture(ScheduledFuture<?> f)Sets a reference to the job that will cancel this session if it exceeds its timeout period.voidsetSessionFuture(Future<?> f)Sets a reference to the job itself that is running this session.booleansubmitTask(SessionTask sessionTask)Adds a task for session to complete.voidtriggerTimeout(long timeout, boolean causedBySession)Provides a general way to interrupt the session by way of a timeout.
 
- 
- 
- 
Method Detail- 
getSessionIdString getSessionId() Gets the identifier for the session.
 - 
submitTaskboolean submitTask(SessionTask sessionTask) throws RejectedExecutionException Adds a task for session to complete.- Throws:
- RejectedExecutionException- if the task cannot be queued
 
 - 
setSessionCancelFuturevoid setSessionCancelFuture(ScheduledFuture<?> f) Sets a reference to the job that will cancel this session if it exceeds its timeout period.
 - 
setSessionFuturevoid setSessionFuture(Future<?> f) Sets a reference to the job itself that is running this session.
 - 
triggerTimeoutvoid triggerTimeout(long timeout, boolean causedBySession)Provides a general way to interrupt the session by way of a timeout.- Parameters:
- timeout- the length of time that passed for the timeout to have triggered
- causedBySession- determines if the timeout triggered due to a particular request (i.e.- falseor because of the session lifetime (i.e.- true
 
 - 
isBoundToboolean isBoundTo(io.netty.channel.Channel channel) Determines if the suppliedChannelobject is the same as the one bound to theSession.
 - 
isAcceptingTasksboolean isAcceptingTasks() Determines if this session can accept additional tasks or not.
 
- 
 
-