public class SessionHandler extends AbstractDatagramHandler
Modifier and Type | Method and Description |
---|---|
void |
event(SessionEvent event)
Called to notify about a change of the associated session state.
|
void |
exception(Throwable e)
Called to notify about an exception caught during processing of I/O or
protocol related operations.
|
ISessionConfig |
getConfig()
Returns the configuration object that will be used to configure the
behavior of the associated session.
|
ISessionStructureFactory |
getFactory()
Returns the factory object that will be used to configure the internal
structure of the associated session.
|
boolean |
incident(SessionIncident incident,
Throwable t)
Called to notify about an incident that occurred during processing of I/O
or protocol related operations.
|
void |
read(Object msg)
Called when a new message was read and decoded from the input buffer.
|
void |
read(SocketAddress remoteAddress,
Object msg)
Called when a new message was received and decoded from a remote end
that is identified by the given remote address.
|
void |
timer(Object event)
Called to notify about an expiration of the timer identified by the
specified event object.
|
event, getSession, read, read, setSession
event, getName, read, read, timer
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
read, read
public void read(SocketAddress remoteAddress, Object msg)
IDatagramHandler
byte[]
and ByteBuffer
.
The method is only called for sessions created with a disconnected datagram channel.
remoteAddress
- address of the remote end.msg
- the message received from the remote end.public void read(Object msg)
IHandler
byte[]
and ByteBuffer
.msg
- the message that was read and decoded from the input buffer.public void timer(Object event)
IHandler
timer
in interface IHandler
timer
in class AbstractHandler
event
- the event object that identifies the timerpublic void event(SessionEvent event)
IHandler
event
in interface IHandler
event
in class AbstractHandler
event
- an event related with the change of the session stateSessionEvent
public void exception(Throwable e)
IHandler
exception
in interface IHandler
exception
in class AbstractHandler
e
- the exception caughtpublic boolean incident(SessionIncident incident, Throwable t)
IHandler
incident
in interface IHandler
incident
in class AbstractHandler
incident
- an incident that occurredt
- an exception that is related with the incident or
null
true
to indicate that the incident was handled and
the default action should not be executed by the SNF4J framework
underneath.public ISessionStructureFactory getFactory()
IHandler
getFactory
in interface IHandler
getFactory
in class AbstractHandler
ISessionStructureFactory
public ISessionConfig getConfig()
IHandler
getConfig
in interface IHandler
getConfig
in class AbstractHandler
ISessionConfig
Copyright © 2017–2022 SNF4J.ORG. All rights reserved.