org.littleshoot.mina.transport.socket.nio.support
Class DatagramSessionImpl

java.lang.Object
  extended by org.littleshoot.mina.common.support.BaseIoSession
      extended by org.littleshoot.mina.transport.socket.nio.support.DatagramSessionImpl
All Implemented Interfaces:
BroadcastIoSession, IoSession

public class DatagramSessionImpl
extends BaseIoSession
implements BroadcastIoSession

An IoSession for datagram transport (UDP/IP).

Version:
$Rev: 585050 $, $Date: 2007-10-16 14:57:53 +0900 (Tue, 16 Oct 2007) $
Author:
The Apache Directory Project (mina-dev@directory.apache.org)

Method Summary
protected  void close0()
          Implement this method to perform real close operation.
 DatagramChannel getChannel()
           
 IoSessionConfig getConfig()
          Returns the configuration of this session.
 IoFilterChain getFilterChain()
          Returns the filter chain that only affects this session.
 IoHandler getHandler()
          Returns the IoHandler which handles this session.
 SocketAddress getLocalAddress()
          Returns the socket address of local machine which is associated with this session.
 SocketAddress getRemoteAddress()
          Returns the socket address of remote peer.
 IoService getService()
          Returns the IoService which provides I/O service to this session.
 SocketAddress getServiceAddress()
          Returns the socket address of the IoService listens to to manage this session.
 IoServiceConfig getServiceConfig()
          Returns the IoServiceConfig of this session.
 TransportType getTransportType()
          Returns transport type of this session.
protected  void updateTrafficMask()
          Signals the IoService that the TrafficMask of this session has been changed.
protected  void write0(IoFilter.WriteRequest writeRequest)
          Implement this method to perform real write operation with the specified writeRequest.
 
Methods inherited from class org.littleshoot.mina.common.support.BaseIoSession
close, containsAttribute, getAttachment, getAttribute, getAttributeKeys, getCloseFuture, getCreationTime, getIdleCount, getIdleTime, getIdleTimeInMillis, getLastIdleTime, getLastIoTime, getLastReadTime, getLastWriteTime, getReadBytes, getReadMessages, getScheduledWriteBytes, getScheduledWriteRequests, getTrafficMask, getWriteTimeout, getWriteTimeoutInMillis, getWrittenBytes, getWrittenMessages, getWrittenWriteRequests, increaseIdleCount, increaseReadBytes, increaseReadMessages, increaseScheduledWriteBytes, increaseScheduledWriteRequests, increaseWrittenBytes, increaseWrittenMessages, isClosing, isConnected, isIdle, isScheduledForFlush, removeAttribute, resumeRead, resumeWrite, setAttachment, setAttribute, setAttribute, setIdleTime, setScheduledForFlush, setTrafficMask, setWriteTimeout, suspendRead, suspendWrite, toString, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.littleshoot.mina.common.BroadcastIoSession
write
 
Methods inherited from interface org.littleshoot.mina.common.IoSession
close, containsAttribute, getAttachment, getAttribute, getAttributeKeys, getCloseFuture, getCreationTime, getIdleCount, getIdleTime, getIdleTimeInMillis, getLastIdleTime, getLastIoTime, getLastReadTime, getLastWriteTime, getReadBytes, getReadMessages, getScheduledWriteBytes, getScheduledWriteRequests, getTrafficMask, getWriteTimeout, getWriteTimeoutInMillis, getWrittenBytes, getWrittenMessages, getWrittenWriteRequests, isClosing, isConnected, isIdle, removeAttribute, resumeRead, resumeWrite, setAttachment, setAttribute, setAttribute, setIdleTime, setTrafficMask, setWriteTimeout, suspendRead, suspendWrite, write
 

Method Detail

getService

public IoService getService()
Description copied from interface: IoSession
Returns the IoService which provides I/O service to this session.

Specified by:
getService in interface IoSession

getServiceConfig

public IoServiceConfig getServiceConfig()
Description copied from interface: IoSession
Returns the IoServiceConfig of this session.

Specified by:
getServiceConfig in interface IoSession

getConfig

public IoSessionConfig getConfig()
Description copied from interface: IoSession
Returns the configuration of this session.

Specified by:
getConfig in interface IoSession

getFilterChain

public IoFilterChain getFilterChain()
Description copied from interface: IoSession
Returns the filter chain that only affects this session.

Specified by:
getFilterChain in interface IoSession

getChannel

public DatagramChannel getChannel()

getHandler

public IoHandler getHandler()
Description copied from interface: IoSession
Returns the IoHandler which handles this session.

Specified by:
getHandler in interface IoSession

close0

protected void close0()
Description copied from class: BaseIoSession
Implement this method to perform real close operation. By default, this method is implemented to set the future to 'closed' immediately.

Overrides:
close0 in class BaseIoSession

write0

protected void write0(IoFilter.WriteRequest writeRequest)
Description copied from class: BaseIoSession
Implement this method to perform real write operation with the specified writeRequest. By default, this method is implemented to set the future to 'not written' immediately.

Overrides:
write0 in class BaseIoSession
Parameters:
writeRequest - Write request to make

getTransportType

public TransportType getTransportType()
Description copied from interface: IoSession
Returns transport type of this session.

Specified by:
getTransportType in interface IoSession

getRemoteAddress

public SocketAddress getRemoteAddress()
Description copied from interface: IoSession
Returns the socket address of remote peer.

Specified by:
getRemoteAddress in interface IoSession

getLocalAddress

public SocketAddress getLocalAddress()
Description copied from interface: IoSession
Returns the socket address of local machine which is associated with this session.

Specified by:
getLocalAddress in interface IoSession

getServiceAddress

public SocketAddress getServiceAddress()
Description copied from interface: IoSession
Returns the socket address of the IoService listens to to manage this session. If this session is managed by IoAcceptor, it returns the SocketAddress which is specified as a parameter of IoAcceptor.bind(SocketAddress, IoHandler). If this session is managed by IoConnector, this method returns the same address with that of IoSession.getRemoteAddress().

Specified by:
getServiceAddress in interface IoSession

updateTrafficMask

protected void updateTrafficMask()
Description copied from class: BaseIoSession
Signals the IoService that the TrafficMask of this session has been changed.

Specified by:
updateTrafficMask in class BaseIoSession


Copyright © 2011 LittleShoot. All Rights Reserved.