public interface Session extends Runnable
UnifiedHandler
are all processed within a Session
implementation.
A session accepts a SessionTask
as 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 the
SingleTaskSession
or may be longer-lived by handling multiple tasks, as with the MultiTaskSession
.Modifier and Type | Field and Description |
---|---|
static com.codahale.metrics.Timer |
evalOpTimer |
static com.codahale.metrics.Timer |
traversalOpTimer |
Modifier and Type | Method and Description |
---|---|
String |
getSessionId()
Gets the identifier for the session.
|
boolean |
isAcceptingTasks()
Determines if this session can accept additional tasks or not.
|
boolean |
isBoundTo(io.netty.channel.Channel channel)
Determines if the supplied
Channel object is the same as the one bound to the Session . |
void |
setSessionCancelFuture(ScheduledFuture<?> f)
Sets a reference to the job that will cancel this session if it exceeds its timeout period.
|
void |
setSessionFuture(Future<?> f)
Sets a reference to the job itself that is running this session.
|
boolean |
submitTask(SessionTask sessionTask)
Adds a task for session to complete.
|
void |
triggerTimeout(long timeout,
boolean causedBySession)
Provides a general way to interrupt the session by way of a timeout.
|
static final com.codahale.metrics.Timer traversalOpTimer
static final com.codahale.metrics.Timer evalOpTimer
String getSessionId()
boolean submitTask(SessionTask sessionTask) throws RejectedExecutionException
RejectedExecutionException
- if the task cannot be queuedvoid setSessionCancelFuture(ScheduledFuture<?> f)
void setSessionFuture(Future<?> f)
void triggerTimeout(long timeout, boolean causedBySession)
timeout
- the length of time that passed for the timeout to have triggeredcausedBySession
- determines if the timeout triggered due to a particular request (i.e. false
or
because of the session lifetime (i.e. true
boolean isBoundTo(io.netty.channel.Channel channel)
Channel
object is the same as the one bound to the Session
.boolean isAcceptingTasks()
Copyright © 2013–2022 Apache Software Foundation. All rights reserved.