net.sf.cindy.session.nio
Class DatagramChannelSession

java.lang.Object
  extended by net.sf.cindy.session.AbstractSession
      extended by net.sf.cindy.session.nio.AbstractChannelSession
          extended by net.sf.cindy.session.nio.DatagramChannelSession
All Implemented Interfaces:
Session

public class DatagramChannelSession
extends AbstractChannelSession

Datagram channel session.

Version:
$id$
Author:
Roger Chen

Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.cindy.session.nio.AbstractChannelSession
AbstractChannelSession.ChannelReactorHandler
 
Constructor Summary
DatagramChannelSession()
           
 
Method Summary
protected  void doClose()
           
protected  void doStart()
           
 java.nio.channels.DatagramChannel getChannel()
          Get datagram channel associted with the session.
 java.net.SocketAddress getLocalAddress()
          Get the local address which the session bind with.
protected  ReactorHandler getReactorHandler()
          Get reactor handler.
 java.net.SocketAddress getRemoteAddress()
          Get the remote address which the session connmected to.
 SessionType getSessionType()
          Get session type.
 java.net.DatagramSocket getSocket()
           
 void setChannel(java.nio.channels.DatagramChannel channel)
          Set the datagram channel which the session will used.
 
Methods inherited from class net.sf.cindy.session.nio.AbstractChannelSession
close, getReactor, isStarted, send, start
 
Methods inherited from class net.sf.cindy.session.AbstractSession
addSessionFilter, addSessionFilter, containsAttribute, dispatchException, flush, flush, getAttribute, getAttributes, getPacketDecoder, getPacketEncoder, getReadPacketSize, 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
 

Constructor Detail

DatagramChannelSession

public DatagramChannelSession()
Method Detail

getSocket

public java.net.DatagramSocket getSocket()

getSessionType

public SessionType getSessionType()
Description copied from interface: Session
Get session type.

Returns:
session type

getRemoteAddress

public java.net.SocketAddress getRemoteAddress()
Description copied from interface: Session
Get the remote address which the session connmected to.

Specified by:
getRemoteAddress in interface Session
Overrides:
getRemoteAddress in class AbstractSession
Returns:
the remote address

getLocalAddress

public java.net.SocketAddress getLocalAddress()
Description copied from interface: Session
Get the local address which the session bind with.

Specified by:
getLocalAddress in interface Session
Overrides:
getLocalAddress in class AbstractSession
Returns:
the local address

setChannel

public void setChannel(java.nio.channels.DatagramChannel channel)
Set the datagram channel which the session will used.

Parameters:
channel - datagram channel
Throws:
java.lang.IllegalStateException

getChannel

public java.nio.channels.DatagramChannel getChannel()
Get datagram channel associted with the session.

Returns:
datagram channel

getReactorHandler

protected ReactorHandler getReactorHandler()
Description copied from class: AbstractChannelSession
Get reactor handler.

Specified by:
getReactorHandler in class AbstractChannelSession
Returns:
reactor handler

doStart

protected void doStart()
                throws java.io.IOException
Overrides:
doStart in class AbstractChannelSession
Throws:
java.io.IOException

doClose

protected void doClose()
Overrides:
doClose in class AbstractChannelSession