org.apache.mina.examples.sumup
Class ServerSessionHandler

java.lang.Object
  extended by org.apache.mina.examples.sumup.ServerSessionHandler
All Implemented Interfaces:
ProtocolHandler

public class ServerSessionHandler
extends Object
implements ProtocolHandler

ProtocolHandler for SumUp server.

Version:
$Rev: 332218 $, $Date: 2005-11-10 12:52:42 +0900 $
Author:
The Apache Directory Project

Constructor Summary
ServerSessionHandler()
           
 
Method Summary
 void exceptionCaught(ProtocolSession session, Throwable cause)
          Invoked when any exception is thrown by user ProtocolHandler implementation or by MINA.
 void messageReceived(ProtocolSession session, Object message)
          Invoked when protocol message is received.
 void messageSent(ProtocolSession session, Object message)
          Invoked when protocol message that user requested by ProtocolSession.write(Object) is sent out actually.
 void sessionClosed(ProtocolSession session)
          Invoked when the connection is closed.
 void sessionCreated(ProtocolSession session)
          Invoked when the session is created.
 void sessionIdle(ProtocolSession session, IdleStatus status)
          Invoked when the connection is idle.
 void sessionOpened(ProtocolSession session)
          Invoked when the connection is opened.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerSessionHandler

public ServerSessionHandler()
Method Detail

sessionCreated

public void sessionCreated(ProtocolSession session)
                    throws Exception
Description copied from interface: ProtocolHandler
Invoked when the session is created. Initialize default socket parameters and user-defined attributes here.

Specified by:
sessionCreated in interface ProtocolHandler
Throws:
Exception

sessionOpened

public void sessionOpened(ProtocolSession session)
Description copied from interface: ProtocolHandler
Invoked when the connection is opened. This method is not invoked if the transport type is UDP.

Specified by:
sessionOpened in interface ProtocolHandler

sessionClosed

public void sessionClosed(ProtocolSession session)
Description copied from interface: ProtocolHandler
Invoked when the connection is closed. This method is not invoked if the transport type is UDP.

Specified by:
sessionClosed in interface ProtocolHandler

messageReceived

public void messageReceived(ProtocolSession session,
                            Object message)
Description copied from interface: ProtocolHandler
Invoked when protocol message is received. Implement your protocol flow here.

Specified by:
messageReceived in interface ProtocolHandler

messageSent

public void messageSent(ProtocolSession session,
                        Object message)
Description copied from interface: ProtocolHandler
Invoked when protocol message that user requested by ProtocolSession.write(Object) is sent out actually.

Specified by:
messageSent in interface ProtocolHandler

sessionIdle

public void sessionIdle(ProtocolSession session,
                        IdleStatus status)
Description copied from interface: ProtocolHandler
Invoked when the connection is idle. Refer to IdleStatus. This method is not invoked if the transport type is UDP.

Specified by:
sessionIdle in interface ProtocolHandler

exceptionCaught

public void exceptionCaught(ProtocolSession session,
                            Throwable cause)
Description copied from interface: ProtocolHandler
Invoked when any exception is thrown by user ProtocolHandler implementation or by MINA. If cause is instanceof IOException, MINA will close the connection automatically.

Specified by:
exceptionCaught in interface ProtocolHandler


Copyright © 2004-2005 . All Rights Reserved.