net.sf.cindy.session.nio
Class AbstractChannelSession

java.lang.Object
  extended by net.sf.cindy.session.AbstractSession
      extended by net.sf.cindy.session.nio.AbstractChannelSession
All Implemented Interfaces:
Session
Direct Known Subclasses:
DatagramChannelSession, PipeSession, ServerSocketChannelSession, SocketChannelSession

public abstract class AbstractChannelSession
extends AbstractSession

Abstract selectable channel session.

Version:
$id$
Author:
Roger Chen

Nested Class Summary
protected  class AbstractChannelSession.ChannelReactorHandler
          Translate reactor events to session events.
 
Constructor Summary
AbstractChannelSession()
           
 
Method Summary
 Future close()
          Close the session.
protected  void doClose()
           
protected  void doStart()
           
protected  Reactor getReactor()
           
protected abstract  ReactorHandler getReactorHandler()
          Get reactor handler.
 boolean isStarted()
          Session have started.
protected  Future send(java.lang.Object obj, Packet packet, int priority)
           
 Future start()
          Start the session.
 
Methods inherited from class net.sf.cindy.session.AbstractSession
addSessionFilter, addSessionFilter, containsAttribute, dispatchException, flush, flush, getAttribute, getAttributes, getLocalAddress, getPacketDecoder, getPacketEncoder, getReadPacketSize, getRemoteAddress, getSessionFilter, getSessionFilterChain, getSessionFilterChain, getSessionFilters, getSessionHandler, getSessionTimeout, removeAttribute, removeSessionFilter, send, send, setAttribute, setLocalAddress, setPacketDecoder, setPacketEncoder, setReadPacketSize, setRemoteAddress, setSessionHandler, setSessionTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.cindy.Session
getSessionType
 

Constructor Detail

AbstractChannelSession

public AbstractChannelSession()
Method Detail

getReactorHandler

protected abstract ReactorHandler getReactorHandler()
Get reactor handler.

Returns:
reactor handler

getReactor

protected final Reactor getReactor()

send

protected Future send(java.lang.Object obj,
                      Packet packet,
                      int priority)
Specified by:
send in class AbstractSession

isStarted

public boolean isStarted()
Description copied from interface: Session
Session have started.

Returns:
session have started

close

public Future close()
             throws java.lang.IllegalStateException
Description copied from interface: Session
Close the session.

Returns:
close future
Throws:
java.lang.IllegalStateException

doClose

protected void doClose()

start

public Future start()
Description copied from interface: Session
Start the session.

Returns:
start future

doStart

protected void doStart()
                throws java.io.IOException
Throws:
java.io.IOException