public abstract class AbstractSessionTimer extends Object implements ISessionTimer
ISessionTimer
interface. It provides
mechanisms for integration with the session's handler.Modifier | Constructor and Description |
---|---|
protected |
AbstractSessionTimer(DatagramSession session)
Constructs a session timer that can be associated with datagram-oriented
sessions.
|
protected |
AbstractSessionTimer(StreamSession session)
Constructs a session timer that can be associated with stream-oriented
sessions.
|
Modifier and Type | Method and Description |
---|---|
protected Runnable |
wrapEvent(Object event)
Wraps the specified event object into a task object that can be used for
delivering the event object to the session's handler.
|
protected Runnable |
wrapTask(Runnable task)
Wraps the specified task into a task object that can be used for
delivering the specified task to the session's handler.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isSupported, scheduleEvent, scheduleEvent, scheduleTask, scheduleTask
protected AbstractSessionTimer(StreamSession session)
session
- the session to which this the timer is to be associated withprotected AbstractSessionTimer(DatagramSession session)
session
- the session to which this the timer is to be associated withprotected final Runnable wrapEvent(Object event)
IHandler.timer(Object)
will be always called in selector loop's
thread that handles the associated session.event
- the event object to be wrappedprotected final Runnable wrapTask(Runnable task)
IHandler.timer(Runnable)
will be always called in selector loop's
thread that handles the associated session.
The return wrapping task will never execute the task being wrapped. It will only deliver it safely to the hadnler's method.
task
- the task to be wrappedCopyright © 2017–2021 SNF4J.ORG. All rights reserved.