org.apache.mina.protocol.io
Class IoProtocolAcceptor

java.lang.Object
  extended by org.apache.mina.protocol.io.IoProtocolAcceptor
All Implemented Interfaces:
SessionManager, ProtocolAcceptor, ProtocolSessionManager

public class IoProtocolAcceptor
extends Object
implements ProtocolAcceptor

A ProtocolAcceptor which wraps IoAcceptor to provide low-level I/O.

Please note that the user-defined attributes of ProtocolSession and its wrapping IoSession are shared.

Version:
$Rev: 332218 $, $Date: 2005-11-10 12:52:42 +0900 $
Author:
The Apache Directory Project (dev@directory.apache.org)

Constructor Summary
IoProtocolAcceptor(IoAcceptor acceptor)
          Creates a new instance with the specified IoAcceptor.
 
Method Summary
 void bind(SocketAddress address, ProtocolProvider provider)
          Binds to the specified address and handles incoming connections with the specified protocolProvider.
 ExceptionMonitor getExceptionMonitor()
          Returns the current exception monitor.
 ProtocolFilterChain getFilterChain()
          Returns the filter chain that filters all events which is related with sessions this manager manages.
 IoAcceptor getIoAcceptor()
          Returns the underlying IoAcceptor instance this acceptor is wrapping.
 ProtocolSession newSession(SocketAddress remoteAddress, SocketAddress localAddress)
          (Optional) Returns a ProtocolSession that is bound to the specified localAddress and remoteAddress which reuses the localAddress that is already bound by ProtocolAcceptor via ProtocolAcceptor.bind(SocketAddress, ProtocolProvider).
 void setExceptionMonitor(ExceptionMonitor monitor)
          Sets the uncaught exception monitor.
 void unbind(SocketAddress address)
          Unbinds from the specified address.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IoProtocolAcceptor

public IoProtocolAcceptor(IoAcceptor acceptor)
Creates a new instance with the specified IoAcceptor.

Method Detail

getIoAcceptor

public IoAcceptor getIoAcceptor()
Returns the underlying IoAcceptor instance this acceptor is wrapping.


bind

public void bind(SocketAddress address,
                 ProtocolProvider provider)
          throws IOException
Description copied from interface: ProtocolAcceptor
Binds to the specified address and handles incoming connections with the specified protocolProvider.

Specified by:
bind in interface ProtocolAcceptor
Throws:
IOException - if failed to bind

unbind

public void unbind(SocketAddress address)
Description copied from interface: ProtocolAcceptor
Unbinds from the specified address.

Specified by:
unbind in interface ProtocolAcceptor

newSession

public ProtocolSession newSession(SocketAddress remoteAddress,
                                  SocketAddress localAddress)
Description copied from interface: ProtocolAcceptor
(Optional) Returns a ProtocolSession that is bound to the specified localAddress and remoteAddress which reuses the localAddress that is already bound by ProtocolAcceptor via ProtocolAcceptor.bind(SocketAddress, ProtocolProvider).

This operation is optional. Please throw UnsupportedOperationException if the transport type doesn't support this operation. This operation is usually implemented for connectionless transport types.

Specified by:
newSession in interface ProtocolAcceptor

getFilterChain

public ProtocolFilterChain getFilterChain()
Description copied from interface: ProtocolSessionManager
Returns the filter chain that filters all events which is related with sessions this manager manages.

Specified by:
getFilterChain in interface ProtocolSessionManager

getExceptionMonitor

public ExceptionMonitor getExceptionMonitor()
Description copied from interface: SessionManager
Returns the current exception monitor.

Specified by:
getExceptionMonitor in interface SessionManager

setExceptionMonitor

public void setExceptionMonitor(ExceptionMonitor monitor)
Description copied from interface: SessionManager
Sets the uncaught exception monitor. If null is specified, a new instance of DefaultExceptionMonitor will be set.

Specified by:
setExceptionMonitor in interface SessionManager
Parameters:
monitor - A new instance of DefaultExceptionMonitor is set if null is specified.


Copyright © 2004-2005 . All Rights Reserved.