org.apache.mina.common
Class AbstractPollingIoConnector<T extends AbstractIoSession,H>

java.lang.Object
  extended by org.apache.mina.common.AbstractIoService
      extended by org.apache.mina.common.AbstractIoConnector
          extended by org.apache.mina.common.AbstractPollingIoConnector<T,H>
All Implemented Interfaces:
IoConnector, IoService
Direct Known Subclasses:
AprSocketConnector, NioDatagramConnector, NioSocketConnector

public abstract class AbstractPollingIoConnector<T extends AbstractIoSession,H>
extends AbstractIoConnector

Version:
$Rev: 607163 $, $Date: 2007-12-28 04:20:07 +0100 (Fri, 28 Dec 2007) $
Author:
The Apache MINA Project (dev@mina.apache.org)

Nested Class Summary
protected  class AbstractPollingIoConnector.ConnectionRequest
           
 
Nested classes/interfaces inherited from class org.apache.mina.common.AbstractIoService
AbstractIoService.ServiceOperationFuture
 
Constructor Summary
protected AbstractPollingIoConnector(IoSessionConfig sessionConfig, Class<? extends IoProcessor<T>> processorClass)
           
protected AbstractPollingIoConnector(IoSessionConfig sessionConfig, Class<? extends IoProcessor<T>> processorClass, int processorCount)
           
protected AbstractPollingIoConnector(IoSessionConfig sessionConfig, Executor executor, IoProcessor<T> processor)
           
protected AbstractPollingIoConnector(IoSessionConfig sessionConfig, IoProcessor<T> processor)
           
 
Method Summary
protected abstract  Iterator<H> allHandles()
           
protected abstract  void close(H handle)
           
protected abstract  boolean connect(H handle, SocketAddress remoteAddress)
           
protected  ConnectFuture connect0(SocketAddress remoteAddress, SocketAddress localAddress, IoSessionInitializer<? extends ConnectFuture> sessionInitializer)
          Implement this method to perform the actual connect operation.
protected abstract  AbstractPollingIoConnector.ConnectionRequest connectionRequest(H handle)
           
protected abstract  void destroy()
           
protected  IoFuture dispose0()
          Implement this method to release any acquired resources.
protected abstract  boolean finishConnect(H handle)
           
protected abstract  void init()
           
protected abstract  H newHandle(SocketAddress localAddress)
           
protected abstract  T newSession(IoProcessor<T> processor, H handle)
           
protected abstract  void register(H handle, AbstractPollingIoConnector.ConnectionRequest request)
           
protected abstract  boolean select(int timeout)
           
protected abstract  Iterator<H> selectedHandles()
           
protected abstract  void wakeup()
           
 
Methods inherited from class org.apache.mina.common.AbstractIoConnector
connect, connect, connect, connect, connect, connect, finishSessionInitialization0, getConnectTimeout, getConnectTimeoutMillis, getDefaultRemoteAddress, setConnectTimeout, setDefaultRemoteAddress, toString
 
Methods inherited from class org.apache.mina.common.AbstractIoService
addListener, broadcast, decreaseScheduledWriteMessages, dispose, finishSessionInitialization, getActivationTime, getBothIdleCount, getBothIdleTime, getBothIdleTimeInMillis, getCumulativeManagedSessionCount, getFilterChain, getFilterChainBuilder, getHandler, getIdleCount, getIdleTime, getIdleTimeInMillis, getLargestManagedSessionCount, getLargestReadBytesThroughput, getLargestReadMessagesThroughput, getLargestWrittenBytesThroughput, getLargestWrittenMessagesThroughput, getLastBothIdleTime, getLastIdleTime, getLastIoTime, getLastReaderIdleTime, getLastReadTime, getLastWriterIdleTime, getLastWriteTime, getListeners, getManagedSessionCount, getManagedSessions, getReadBytes, getReadBytesThroughput, getReaderIdleCount, getReaderIdleTime, getReaderIdleTimeInMillis, getReadMessages, getReadMessagesThroughput, getScheduledWriteBytes, getScheduledWriteMessages, getSessionConfig, getSessionDataStructureFactory, getThroughputCalculationInterval, getThroughputCalculationIntervalInMillis, getWriterIdleCount, getWriterIdleTime, getWriterIdleTimeInMillis, getWrittenBytes, getWrittenBytesThroughput, getWrittenMessages, getWrittenMessagesThroughput, increaseReadBytes, increaseReadMessages, increaseScheduledWriteBytes, increaseScheduledWriteMessages, increaseWrittenBytes, increaseWrittenMessages, isActive, isBothIdle, isDisposed, isDisposing, isIdle, isReaderIdle, isWriterIdle, notifyIdleness, removeListener, setBothIdleTime, setFilterChainBuilder, setHandler, setIdleTime, setLastReadTime, setLastWriteTime, setReaderIdleTime, setSessionDataStructureFactory, setThroughputCalculationInterval, setWriterIdleTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.mina.common.IoService
addListener, broadcast, dispose, getActivationTime, getBothIdleCount, getBothIdleTime, getBothIdleTimeInMillis, getCumulativeManagedSessionCount, getFilterChain, getFilterChainBuilder, getHandler, getIdleCount, getIdleTime, getIdleTimeInMillis, getLargestManagedSessionCount, getLargestReadBytesThroughput, getLargestReadMessagesThroughput, getLargestWrittenBytesThroughput, getLargestWrittenMessagesThroughput, getLastBothIdleTime, getLastIdleTime, getLastIoTime, getLastReaderIdleTime, getLastReadTime, getLastWriterIdleTime, getLastWriteTime, getManagedSessionCount, getManagedSessions, getReadBytes, getReadBytesThroughput, getReaderIdleCount, getReaderIdleTime, getReaderIdleTimeInMillis, getReadMessages, getReadMessagesThroughput, getScheduledWriteBytes, getScheduledWriteMessages, getSessionConfig, getSessionDataStructureFactory, getThroughputCalculationInterval, getThroughputCalculationIntervalInMillis, getTransportMetadata, getWriterIdleCount, getWriterIdleTime, getWriterIdleTimeInMillis, getWrittenBytes, getWrittenBytesThroughput, getWrittenMessages, getWrittenMessagesThroughput, isActive, isBothIdle, isDisposed, isDisposing, isIdle, isReaderIdle, isWriterIdle, removeListener, setBothIdleTime, setFilterChainBuilder, setHandler, setIdleTime, setReaderIdleTime, setSessionDataStructureFactory, setThroughputCalculationInterval, setWriterIdleTime
 

Constructor Detail

AbstractPollingIoConnector

protected AbstractPollingIoConnector(IoSessionConfig sessionConfig,
                                     Class<? extends IoProcessor<T>> processorClass)

AbstractPollingIoConnector

protected AbstractPollingIoConnector(IoSessionConfig sessionConfig,
                                     Class<? extends IoProcessor<T>> processorClass,
                                     int processorCount)

AbstractPollingIoConnector

protected AbstractPollingIoConnector(IoSessionConfig sessionConfig,
                                     IoProcessor<T> processor)

AbstractPollingIoConnector

protected AbstractPollingIoConnector(IoSessionConfig sessionConfig,
                                     Executor executor,
                                     IoProcessor<T> processor)
Method Detail

init

protected abstract void init()
                      throws Exception
Throws:
Exception

destroy

protected abstract void destroy()
                         throws Exception
Throws:
Exception

newHandle

protected abstract H newHandle(SocketAddress localAddress)
                        throws Exception
Throws:
Exception

connect

protected abstract boolean connect(H handle,
                                   SocketAddress remoteAddress)
                            throws Exception
Throws:
Exception

finishConnect

protected abstract boolean finishConnect(H handle)
                                  throws Exception
Throws:
Exception

newSession

protected abstract T newSession(IoProcessor<T> processor,
                                H handle)
                                                   throws Exception
Throws:
Exception

close

protected abstract void close(H handle)
                       throws Exception
Throws:
Exception

wakeup

protected abstract void wakeup()

select

protected abstract boolean select(int timeout)
                           throws Exception
Throws:
Exception

selectedHandles

protected abstract Iterator<H> selectedHandles()

allHandles

protected abstract Iterator<H> allHandles()

register

protected abstract void register(H handle,
                                 AbstractPollingIoConnector.ConnectionRequest request)
                          throws Exception
Throws:
Exception

connectionRequest

protected abstract AbstractPollingIoConnector.ConnectionRequest connectionRequest(H handle)

dispose0

protected final IoFuture dispose0()
                           throws Exception
Description copied from class: AbstractIoService
Implement this method to release any acquired resources. This method is invoked only once by AbstractIoService.dispose().

Specified by:
dispose0 in class AbstractIoService
Throws:
Exception

connect0

protected final ConnectFuture connect0(SocketAddress remoteAddress,
                                       SocketAddress localAddress,
                                       IoSessionInitializer<? extends ConnectFuture> sessionInitializer)
Description copied from class: AbstractIoConnector
Implement this method to perform the actual connect operation.

Specified by:
connect0 in class AbstractIoConnector
localAddress - null if no local address is specified


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