org.apache.mina.transport.socket.nio
Class MultiThreadSocketAcceptor

java.lang.Object
  extended by org.apache.mina.common.support.BaseIoService
      extended by org.apache.mina.common.support.BaseIoAcceptor
          extended by org.apache.mina.transport.socket.nio.SocketAcceptor
              extended by org.apache.mina.transport.socket.nio.MultiThreadSocketAcceptor
All Implemented Interfaces:
org.apache.mina.common.IoAcceptor, org.apache.mina.common.IoService

public class MultiThreadSocketAcceptor
extends org.apache.mina.transport.socket.nio.SocketAcceptor

IoAcceptor for socket transport (TCP/IP).

Version:
$Rev: 619823 $, $Date: 2008-02-08 10:09:37 +0000 (Fri, 08 Feb 2008) $

Constructor Summary
MultiThreadSocketAcceptor()
          Create an acceptor with a single processing thread using a NewThreadExecutor
MultiThreadSocketAcceptor(int processorCount, edu.emory.mathcs.backport.java.util.concurrent.Executor executor)
          Create an acceptor with the desired number of processing threads
 
Method Summary
 void bind(SocketAddress address, org.apache.mina.common.IoHandler handler, org.apache.mina.common.IoServiceConfig config)
          Binds to the specified address and handles incoming connections with the specified handler.
 void unbind(SocketAddress address)
           
 
Methods inherited from class org.apache.mina.transport.socket.nio.SocketAcceptor
, getDefaultConfig, setDefaultConfig, unbindAll
 
Methods inherited from class org.apache.mina.common.support.BaseIoAcceptor
bind, newSession
 
Methods inherited from class org.apache.mina.common.support.BaseIoService
addListener, getFilterChain, getFilterChainBuilder, getListeners, getManagedServiceAddresses, getManagedSessions, isManaged, removeListener, setFilterChainBuilder
 
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.IoService
addListener, getFilterChain, getFilterChainBuilder, getManagedServiceAddresses, getManagedSessions, isManaged, removeListener, setFilterChainBuilder
 

Constructor Detail

MultiThreadSocketAcceptor

public MultiThreadSocketAcceptor()
Create an acceptor with a single processing thread using a NewThreadExecutor


MultiThreadSocketAcceptor

public MultiThreadSocketAcceptor(int processorCount,
                                 edu.emory.mathcs.backport.java.util.concurrent.Executor executor)
Create an acceptor with the desired number of processing threads

Parameters:
processorCount - Number of processing threads
executor - Executor to use for launching threads
Method Detail

bind

public void bind(SocketAddress address,
                 org.apache.mina.common.IoHandler handler,
                 org.apache.mina.common.IoServiceConfig config)
          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 org.apache.mina.common.IoAcceptor
Overrides:
bind in class org.apache.mina.transport.socket.nio.SocketAcceptor
Throws:
IOException - if failed to bind

unbind

public void unbind(SocketAddress address)
Specified by:
unbind in interface org.apache.mina.common.IoAcceptor
Overrides:
unbind in class org.apache.mina.transport.socket.nio.SocketAcceptor


Licensed to the Apache Software Foundation