org.apache.mina.transport.socket.apr
Class AprSocketAcceptor

java.lang.Object
  extended by org.apache.mina.core.service.AbstractIoService
      extended by org.apache.mina.core.service.AbstractIoAcceptor
          extended by org.apache.mina.core.polling.AbstractPollingIoAcceptor<AprSession,java.lang.Long>
              extended by org.apache.mina.transport.socket.apr.AprSocketAcceptor
All Implemented Interfaces:
IoAcceptor, IoService, SocketAcceptor

public final class AprSocketAcceptor
extends AbstractPollingIoAcceptor<AprSession,java.lang.Long>
implements SocketAcceptor

IoAcceptor for APR based socket transport (TCP/IP).

Author:
Apache MINA Project

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.mina.core.service.AbstractIoAcceptor
AbstractIoAcceptor.AcceptorOperationFuture
 
Nested classes/interfaces inherited from class org.apache.mina.core.service.AbstractIoService
AbstractIoService.ServiceOperationFuture
 
Field Summary
 
Fields inherited from class org.apache.mina.core.polling.AbstractPollingIoAcceptor
backlog, reuseAddress
 
Fields inherited from class org.apache.mina.core.service.AbstractIoAcceptor
bindLock
 
Fields inherited from class org.apache.mina.core.service.AbstractIoService
disposalLock
 
Constructor Summary
AprSocketAcceptor()
          Constructor for AprSocketAcceptor using default parameters (multiple thread model).
AprSocketAcceptor(java.util.concurrent.Executor executor, IoProcessor<AprSession> processor)
          Constructor for AprSocketAcceptor with a given Executor for handling connection events and a given AprIoProcessor for handling I/O events, useful for sharing the same processor and executor over multiple IoService of the same type.
AprSocketAcceptor(int processorCount)
          Constructor for AprSocketAcceptor using default parameters, and given number of AprIoProcessor for multithreading I/O operations.
AprSocketAcceptor(IoProcessor<AprSession> processor)
          Constructor for AprSocketAcceptor with default configuration but a specific AprIoProcessor, useful for sharing the same processor over multiple IoService of the same type.
 
Method Summary
protected  AprSession accept(IoProcessor<AprSession> processor, java.lang.Long handle)
          
protected  void close(java.lang.Long handle)
          
protected  void destroy()
          
 java.net.InetSocketAddress getDefaultLocalAddress()
          
 java.net.InetSocketAddress getLocalAddress()
          
 SocketSessionConfig getSessionConfig()
          
 TransportMetadata getTransportMetadata()
          
protected  void init()
          
protected  java.net.SocketAddress localAddress(java.lang.Long handle)
          
protected  java.lang.Long open(java.net.SocketAddress localAddress)
          
protected  int select()
          
protected  java.util.Iterator<java.lang.Long> selectedHandles()
          
 void setDefaultLocalAddress(java.net.InetSocketAddress localAddress)
          
protected  void wakeup()
          
 
Methods inherited from class org.apache.mina.core.polling.AbstractPollingIoAcceptor
bindInternal, dispose0, getBacklog, isReuseAddress, newSession, setBacklog, setReuseAddress, unbind0
 
Methods inherited from class org.apache.mina.core.service.AbstractIoAcceptor
bind, bind, bind, bind, getDefaultLocalAddresses, getLocalAddresses, isCloseOnDeactivation, setCloseOnDeactivation, setDefaultLocalAddress, setDefaultLocalAddresses, setDefaultLocalAddresses, setDefaultLocalAddresses, toString, unbind, unbind, unbind, unbind
 
Methods inherited from class org.apache.mina.core.service.AbstractIoService
addListener, broadcast, dispose, dispose, executeWorker, executeWorker, finishSessionInitialization0, getActivationTime, getFilterChain, getFilterChainBuilder, getHandler, getListeners, getManagedSessionCount, getManagedSessions, getScheduledWriteBytes, getScheduledWriteMessages, getSessionDataStructureFactory, getStatistics, initSession, isActive, isDisposed, isDisposing, removeListener, setFilterChainBuilder, setHandler, setSessionDataStructureFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.mina.transport.socket.SocketAcceptor
getBacklog, isReuseAddress, setBacklog, setReuseAddress
 
Methods inherited from interface org.apache.mina.core.service.IoAcceptor
bind, bind, bind, bind, getDefaultLocalAddresses, getLocalAddresses, isCloseOnDeactivation, newSession, setCloseOnDeactivation, setDefaultLocalAddress, setDefaultLocalAddresses, setDefaultLocalAddresses, setDefaultLocalAddresses, unbind, unbind, unbind, unbind
 
Methods inherited from interface org.apache.mina.core.service.IoService
addListener, broadcast, dispose, dispose, getActivationTime, getFilterChain, getFilterChainBuilder, getHandler, getManagedSessionCount, getManagedSessions, getScheduledWriteBytes, getScheduledWriteMessages, getSessionDataStructureFactory, getStatistics, isActive, isDisposed, isDisposing, removeListener, setFilterChainBuilder, setHandler, setSessionDataStructureFactory
 

Constructor Detail

AprSocketAcceptor

public AprSocketAcceptor()
Constructor for AprSocketAcceptor using default parameters (multiple thread model).


AprSocketAcceptor

public AprSocketAcceptor(int processorCount)
Constructor for AprSocketAcceptor using default parameters, and given number of AprIoProcessor for multithreading I/O operations.

Parameters:
processorCount - the number of processor to create and place in a SimpleIoProcessorPool

AprSocketAcceptor

public AprSocketAcceptor(IoProcessor<AprSession> processor)
Constructor for AprSocketAcceptor with default configuration but a specific AprIoProcessor, useful for sharing the same processor over multiple IoService of the same type.

Parameters:
processor - the processor to use for managing I/O events

AprSocketAcceptor

public AprSocketAcceptor(java.util.concurrent.Executor executor,
                         IoProcessor<AprSession> processor)
Constructor for AprSocketAcceptor with a given Executor for handling connection events and a given AprIoProcessor for handling I/O events, useful for sharing the same processor and executor over multiple IoService of the same type.

Parameters:
executor - the executor for connection
processor - the processor for I/O operations
Method Detail

accept

protected AprSession accept(IoProcessor<AprSession> processor,
                            java.lang.Long handle)
                     throws java.lang.Exception

Specified by:
accept in class AbstractPollingIoAcceptor<AprSession,java.lang.Long>
Throws:
java.lang.Exception

open

protected java.lang.Long open(java.net.SocketAddress localAddress)
                       throws java.lang.Exception

Specified by:
open in class AbstractPollingIoAcceptor<AprSession,java.lang.Long>
Throws:
java.lang.Exception

init

protected void init()
             throws java.lang.Exception

Specified by:
init in class AbstractPollingIoAcceptor<AprSession,java.lang.Long>
Throws:
java.lang.Exception

destroy

protected void destroy()
                throws java.lang.Exception

Specified by:
destroy in class AbstractPollingIoAcceptor<AprSession,java.lang.Long>
Throws:
java.lang.Exception

localAddress

protected java.net.SocketAddress localAddress(java.lang.Long handle)
                                       throws java.lang.Exception

Specified by:
localAddress in class AbstractPollingIoAcceptor<AprSession,java.lang.Long>
Throws:
java.lang.Exception

select

protected int select()
              throws java.lang.Exception

Specified by:
select in class AbstractPollingIoAcceptor<AprSession,java.lang.Long>
Throws:
java.lang.Exception

selectedHandles

protected java.util.Iterator<java.lang.Long> selectedHandles()

Specified by:
selectedHandles in class AbstractPollingIoAcceptor<AprSession,java.lang.Long>

close

protected void close(java.lang.Long handle)
              throws java.lang.Exception

Specified by:
close in class AbstractPollingIoAcceptor<AprSession,java.lang.Long>
Throws:
java.lang.Exception

wakeup

protected void wakeup()

Specified by:
wakeup in class AbstractPollingIoAcceptor<AprSession,java.lang.Long>

getLocalAddress

public java.net.InetSocketAddress getLocalAddress()

Specified by:
getLocalAddress in interface IoAcceptor
Specified by:
getLocalAddress in interface SocketAcceptor
Overrides:
getLocalAddress in class AbstractIoAcceptor

getDefaultLocalAddress

public java.net.InetSocketAddress getDefaultLocalAddress()

Specified by:
getDefaultLocalAddress in interface IoAcceptor
Specified by:
getDefaultLocalAddress in interface SocketAcceptor
Overrides:
getDefaultLocalAddress in class AbstractIoAcceptor

setDefaultLocalAddress

public void setDefaultLocalAddress(java.net.InetSocketAddress localAddress)

Specified by:
setDefaultLocalAddress in interface SocketAcceptor

getTransportMetadata

public TransportMetadata getTransportMetadata()

Specified by:
getTransportMetadata in interface IoService

getSessionConfig

public SocketSessionConfig getSessionConfig()

Specified by:
getSessionConfig in interface IoService
Specified by:
getSessionConfig in interface SocketAcceptor
Overrides:
getSessionConfig in class AbstractIoService


Copyright © 2004-2012 Apache MINA Project. All Rights Reserved.