org.apache.mina.io.socket
Class SocketAcceptor

java.lang.Object
  extended by org.apache.mina.common.BaseSessionManager
      extended by org.apache.mina.io.socket.SocketAcceptor
All Implemented Interfaces:
SessionManager, IoAcceptor, IoSessionManager

public class SocketAcceptor
extends BaseSessionManager
implements IoAcceptor

IoAcceptor for socket transport (TCP/IP).

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

Field Summary
 
Fields inherited from class org.apache.mina.common.BaseSessionManager
exceptionMonitor
 
Constructor Summary
SocketAcceptor()
          Creates a new instance.
 
Method Summary
 void bind(SocketAddress address, IoHandler handler)
          Binds to the specified address and handles incoming connections with the specified handler.
 int getBacklog()
          Returns the default backlog value which is used when user binds.
 IoFilterChain getFilterChain()
          Returns the filter chain that filters all events which is related with sessions this manager manages.
 IoSession newSession(SocketAddress remoteAddress, SocketAddress localAddress)
          (Optional) Returns an IoSession that is bound to the specified localAddress and remoteAddress which reuses the localAddress that is already bound by IoAcceptor via IoAcceptor.bind(SocketAddress, IoHandler).
 void setBacklog(int defaultBacklog)
          Sets the default backlog value which is used when user binds.
 void unbind(SocketAddress address)
          Unbinds from the specified address.
 
Methods inherited from class org.apache.mina.common.BaseSessionManager
getExceptionMonitor, setExceptionMonitor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.mina.common.SessionManager
getExceptionMonitor, setExceptionMonitor
 

Constructor Detail

SocketAcceptor

public SocketAcceptor()
Creates a new instance.

Method Detail

bind

public void bind(SocketAddress address,
                 IoHandler handler)
          throws IOException
Binds to the specified address and handles incoming connections with the specified handler. Backlog value is configured to the value of backlog property.

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

unbind

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

Specified by:
unbind in interface IoAcceptor

getBacklog

public int getBacklog()
Returns the default backlog value which is used when user binds.


setBacklog

public void setBacklog(int defaultBacklog)
Sets the default backlog value which is used when user binds.


getFilterChain

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

Specified by:
getFilterChain in interface IoSessionManager

newSession

public IoSession newSession(SocketAddress remoteAddress,
                            SocketAddress localAddress)
Description copied from interface: IoAcceptor
(Optional) Returns an IoSession that is bound to the specified localAddress and remoteAddress which reuses the localAddress that is already bound by IoAcceptor via IoAcceptor.bind(SocketAddress, IoHandler).

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 IoAcceptor


Copyright © 2004-2005 . All Rights Reserved.