public class EchoClientHandler extends AbstractStreamHandler
| 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(ByteBuffer data)
Called when new bytes were read from the input buffer.
|
void |
read(Object msg)
Called when a new message was read and decoded from the input buffer.
|
available, available, getSession, setSessionevent, getName, read, timer, timerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreadpublic void read(ByteBuffer data)
AbstractHandlerByteBuffer objects or when the associated
session is configured to optimize data copying and uses an allocator
supporting the releasing of no longer used buffers
The passed byte buffer can be safely stored or modified by this method as it will not be used by the caller. However, if the associated session is configured to optimize data copying and uses an allocator supporting the releasing of no longer used buffers it may be required to release it in this method unless the original buffer has been already released by one of the associated decoders.
By default it simply passes the data value to the
IHandler.read(Object) method.
read in interface IHandlerread in interface IStreamReaderread in class AbstractHandlerdata - bytes that was read from the input buffer.public void read(Object msg)
IHandlerbyte[] and ByteBuffer.msg - the message that was read and decoded from the input buffer.public void event(SessionEvent event)
IHandlerevent in interface IHandlerevent in class AbstractHandlerevent - an event related with the change of the session stateSessionEventpublic void exception(Throwable e)
IHandlerexception in interface IHandlerexception in class AbstractHandlere - the exception caughtpublic boolean incident(SessionIncident incident, Throwable t)
IHandlerincident in interface IHandlerincident in class AbstractHandlerincident - an incident that occurredt - an exception that is related with the incident or
nulltrue to indicate that the incident was handled and
the default action should not be executed by the SNF4J framework
underneath.public ISessionConfig getConfig()
IHandlergetConfig in interface IHandlergetConfig in class AbstractHandlerISessionConfigpublic ISessionStructureFactory getFactory()
IHandlergetFactory in interface IHandlergetFactory in class AbstractHandlerISessionStructureFactoryCopyright © 2017–2022 SNF4J.ORG. All rights reserved.