public abstract class AbstractServerConnectionHandler extends Object implements SingleSessionIoHandler
| Modifier and Type | Field and Description |
|---|---|
protected ConnectionInformation |
connectionInformation |
protected IoSession |
ioSession |
protected Messenger |
messenger |
protected PingService |
pingService |
| Constructor and Description |
|---|
AbstractServerConnectionHandler(IoSession ioSession,
ConnectionInformation connectionInformation) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cleanUp() |
void |
exceptionCaught(Throwable cause)
Invoked when any exception is thrown by user
IoHandler
implementation or by MINA. |
protected boolean |
getBooleanProperty(String propertyName,
boolean defaultValue) |
protected int |
getIntProperty(String propertyName,
int defaultValue) |
int |
getMessageTimeout() |
int |
getPingPeriod() |
protected Map<String,String> |
getTransportProperties(Properties props) |
void |
messageReceived(Object message)
Invoked when protocol message is received.
|
void |
messageSent(Object message)
Invoked when protocol message that user requested by
IoSession.write(Object) is sent out actually. |
protected void |
modifyFilterChain(IoSession ioSession,
Map<String,String> properties) |
protected void |
replySessionCreated(Properties originalProperties,
Message originalMessage,
Map<String,String> sessionProperties) |
protected void |
sendPrivilegeChange(Set<String> privileges) |
void |
sessionClosed()
Invoked when the connection is closed.
|
protected void |
sessionConfigured(Map<String,String> properties) |
void |
sessionCreated()
Invoked when the session is created.
|
void |
sessionIdle(IdleStatus status)
Invoked when the connection is idle.
|
void |
sessionOpened()
Invoked when the connection is opened.
|
protected void |
startSession() |
protected IoSession ioSession
protected final Messenger messenger
protected final PingService pingService
protected final ConnectionInformation connectionInformation
public AbstractServerConnectionHandler(IoSession ioSession, ConnectionInformation connectionInformation)
protected void modifyFilterChain(IoSession ioSession, Map<String,String> properties)
protected Map<String,String> getTransportProperties(Properties props)
protected void replySessionCreated(Properties originalProperties, Message originalMessage, Map<String,String> sessionProperties)
public void exceptionCaught(Throwable cause) throws Exception
SingleSessionIoHandlerIoHandler
implementation or by MINA. If cause is instanceof
IOException, MINA will close the connection automatically.exceptionCaught in interface SingleSessionIoHandlercause - the caught exceptionExceptionIoHandler.exceptionCaught(IoSession, Throwable)public void messageReceived(Object message) throws Exception
SingleSessionIoHandlermessageReceived in interface SingleSessionIoHandlermessage - the received messageExceptionIoHandler.messageReceived(IoSession, Object)protected void startSession()
public void messageSent(Object message) throws Exception
SingleSessionIoHandlerIoSession.write(Object) is sent out actually.messageSent in interface SingleSessionIoHandlermessage - the sent messageExceptionIoHandler.messageSent(IoSession, Object)public void sessionClosed()
throws Exception
SingleSessionIoHandlersessionClosed in interface SingleSessionIoHandlerExceptionIoHandler.sessionClosed(IoSession)protected void cleanUp()
public void sessionCreated()
throws Exception
SingleSessionIoHandlersessionCreated in interface SingleSessionIoHandlerExceptionIoHandler.sessionCreated(IoSession)public void sessionIdle(IdleStatus status) throws Exception
SingleSessionIoHandlerIdleStatus. This
method is not invoked if the transport type is UDP.sessionIdle in interface SingleSessionIoHandlerstatus - the type of idlenessExceptionIoHandler.sessionIdle(IoSession, IdleStatus)public void sessionOpened()
throws Exception
SingleSessionIoHandlersessionOpened in interface SingleSessionIoHandlerExceptionIoHandler.sessionOpened(IoSession)public int getPingPeriod()
public int getMessageTimeout()
protected boolean getBooleanProperty(String propertyName, boolean defaultValue)
protected int getIntProperty(String propertyName, int defaultValue)