public class SwingChatClientHandler extends IoHandlerAdapter
IoHandler
implementation of the client side of the simple chat protocol.Modifier and Type | Class and Description |
---|---|
static interface |
SwingChatClientHandler.Callback |
Constructor and Description |
---|
SwingChatClientHandler(SwingChatClientHandler.Callback callback) |
Modifier and Type | Method and Description |
---|---|
void |
messageReceived(IoSession session,
Object message)
Invoked when a message is received.
|
void |
sessionClosed(IoSession session)
Invoked when a connection is closed.
|
void |
sessionOpened(IoSession session)
Invoked when a connection has been opened.
|
exceptionCaught, inputClosed, messageSent, sessionCreated, sessionIdle
public SwingChatClientHandler(SwingChatClientHandler.Callback callback)
public void sessionOpened(IoSession session) throws Exception
IoHandlerAdapter
IoHandler.sessionCreated(IoSession)
. The biggest difference from
IoHandler.sessionCreated(IoSession)
is that it's invoked from other thread
than an I/O processor thread once thread model is configured properly.sessionOpened
in interface IoHandler
sessionOpened
in class IoHandlerAdapter
session
- The session being openedException
- If we get an exception while processing the open eventpublic void messageReceived(IoSession session, Object message) throws Exception
IoHandlerAdapter
messageReceived
in interface IoHandler
messageReceived
in class IoHandlerAdapter
session
- The session that is receiving a messagemessage
- The received messageException
- If we get an exception while processing the received messagepublic void sessionClosed(IoSession session) throws Exception
IoHandlerAdapter
sessionClosed
in interface IoHandler
sessionClosed
in class IoHandlerAdapter
session
- The session being closedException
- If we get an exception while processing the close eventCopyright © 2004–2016 Apache MINA Project. All rights reserved.