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

java.lang.Object
  extended by org.apache.mina.core.service.AbstractIoService
      extended by org.apache.mina.core.service.AbstractIoConnector
          extended by org.apache.mina.core.polling.AbstractPollingIoConnector<AprSession,java.lang.Long>
              extended by org.apache.mina.transport.socket.apr.AprSocketConnector
All Implemented Interfaces:
IoConnector, IoService, SocketConnector

public final class AprSocketConnector
extends AbstractPollingIoConnector<AprSession,java.lang.Long>
implements SocketConnector

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

Author:
Apache MINA Project

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.mina.core.polling.AbstractPollingIoConnector
AbstractPollingIoConnector.ConnectionRequest
 
Nested classes/interfaces inherited from class org.apache.mina.core.service.AbstractIoService
AbstractIoService.ServiceOperationFuture
 
Field Summary
 
Fields inherited from class org.apache.mina.core.service.AbstractIoService
disposalLock
 
Constructor Summary
AprSocketConnector()
          Create an AprSocketConnector with default configuration (multiple thread model).
AprSocketConnector(java.util.concurrent.Executor executor, IoProcessor<AprSession> processor)
          Constructor for AprSocketConnector with a given Executor for handling connection events and a given IoProcessor for handling I/O events, useful for sharing the same processor and executor over multiple IoService of the same type.
AprSocketConnector(int processorCount)
          Constructor for AprSocketConnector with default configuration, and given number of AprIoProcessor for multithreading I/O operations
AprSocketConnector(IoProcessor<AprSession> processor)
          Constructor for AprSocketConnector with default configuration but a specific IoProcessor, useful for sharing the same processor over multiple IoService of the same type.
 
Method Summary
protected  java.util.Iterator<java.lang.Long> allHandles()
          
protected  void close(java.lang.Long handle)
          
protected  boolean connect(java.lang.Long handle, java.net.SocketAddress remoteAddress)
          
protected  void destroy()
          
protected  boolean finishConnect(java.lang.Long handle)
          
protected  AbstractPollingIoConnector.ConnectionRequest getConnectionRequest(java.lang.Long handle)
          
 java.net.InetSocketAddress getDefaultRemoteAddress()
          
 SocketSessionConfig getSessionConfig()
          
 TransportMetadata getTransportMetadata()
          
protected  void init()
          
protected  java.lang.Long newHandle(java.net.SocketAddress localAddress)
          
protected  AprSession newSession(IoProcessor<AprSession> processor, java.lang.Long handle)
          
protected  void register(java.lang.Long handle, AbstractPollingIoConnector.ConnectionRequest request)
          
protected  int select(int timeout)
          
protected  java.util.Iterator<java.lang.Long> selectedHandles()
          
 void setDefaultRemoteAddress(java.net.InetSocketAddress defaultRemoteAddress)
          
protected  void wakeup()
          
 
Methods inherited from class org.apache.mina.core.polling.AbstractPollingIoConnector
connect0, dispose0
 
Methods inherited from class org.apache.mina.core.service.AbstractIoConnector
connect, connect, connect, connect, connect, connect, finishSessionInitialization0, getConnectTimeout, getConnectTimeoutCheckInterval, getConnectTimeoutMillis, setConnectTimeout, setConnectTimeoutCheckInterval, setConnectTimeoutMillis, setDefaultRemoteAddress, toString
 
Methods inherited from class org.apache.mina.core.service.AbstractIoService
addListener, broadcast, dispose, dispose, executeWorker, executeWorker, 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.core.service.IoConnector
connect, connect, connect, connect, connect, connect, getConnectTimeout, getConnectTimeoutMillis, setConnectTimeout, setConnectTimeoutMillis, setDefaultRemoteAddress
 
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

AprSocketConnector

public AprSocketConnector()
Create an AprSocketConnector with default configuration (multiple thread model).


AprSocketConnector

public AprSocketConnector(int processorCount)
Constructor for AprSocketConnector with default configuration, and given number of AprIoProcessor for multithreading I/O operations

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

AprSocketConnector

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

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

AprSocketConnector

public AprSocketConnector(java.util.concurrent.Executor executor,
                          IoProcessor<AprSession> processor)
Constructor for AprSocketConnector with a given Executor for handling connection events and a given IoProcessor 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

init

protected void init()
             throws java.lang.Exception

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

destroy

protected void destroy()
                throws java.lang.Exception

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

allHandles

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

Specified by:
allHandles in class AbstractPollingIoConnector<AprSession,java.lang.Long>

connect

protected boolean connect(java.lang.Long handle,
                          java.net.SocketAddress remoteAddress)
                   throws java.lang.Exception

Specified by:
connect in class AbstractPollingIoConnector<AprSession,java.lang.Long>
Throws:
java.lang.Exception

getConnectionRequest

protected AbstractPollingIoConnector.ConnectionRequest getConnectionRequest(java.lang.Long handle)

Specified by:
getConnectionRequest in class AbstractPollingIoConnector<AprSession,java.lang.Long>

close

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

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

finishConnect

protected boolean finishConnect(java.lang.Long handle)
                         throws java.lang.Exception

Specified by:
finishConnect in class AbstractPollingIoConnector<AprSession,java.lang.Long>
Throws:
java.lang.Exception

newHandle

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

Specified by:
newHandle in class AbstractPollingIoConnector<AprSession,java.lang.Long>
Throws:
java.lang.Exception

newSession

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

Specified by:
newSession in class AbstractPollingIoConnector<AprSession,java.lang.Long>
Throws:
java.lang.Exception

register

protected void register(java.lang.Long handle,
                        AbstractPollingIoConnector.ConnectionRequest request)
                 throws java.lang.Exception

Specified by:
register in class AbstractPollingIoConnector<AprSession,java.lang.Long>
Throws:
java.lang.Exception

select

protected int select(int timeout)
              throws java.lang.Exception

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

selectedHandles

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

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

wakeup

protected void wakeup()

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

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 SocketConnector
Overrides:
getSessionConfig in class AbstractIoService

getDefaultRemoteAddress

public java.net.InetSocketAddress getDefaultRemoteAddress()

Specified by:
getDefaultRemoteAddress in interface IoConnector
Specified by:
getDefaultRemoteAddress in interface SocketConnector
Overrides:
getDefaultRemoteAddress in class AbstractIoConnector

setDefaultRemoteAddress

public void setDefaultRemoteAddress(java.net.InetSocketAddress defaultRemoteAddress)

Specified by:
setDefaultRemoteAddress in interface SocketConnector


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