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

java.lang.Object
  extended by org.apache.mina.common.AbstractPollingIoProcessor<org.apache.mina.transport.socket.apr.AprSession>
      extended by org.apache.mina.transport.socket.apr.AprIoProcessor
All Implemented Interfaces:
IoProcessor<org.apache.mina.transport.socket.apr.AprSession>

public final class AprIoProcessor
extends AbstractPollingIoProcessor<org.apache.mina.transport.socket.apr.AprSession>

The class in charge of processing socket level IO events for the AprSocketConnector

Version:
$Rev: 599788 $, $Date: 2007-11-30 12:42:57 +0100 (Fri, 30 Nov 2007) $
Author:
The Apache MINA Project (dev@mina.apache.org)

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.mina.common.AbstractPollingIoProcessor
AbstractPollingIoProcessor.SessionState
 
Constructor Summary
AprIoProcessor(Executor executor)
           
 
Method Summary
protected  Iterator<org.apache.mina.transport.socket.apr.AprSession> allSessions()
           
protected  void destroy(org.apache.mina.transport.socket.apr.AprSession session)
           
protected  void dispose0()
           
protected  void init(org.apache.mina.transport.socket.apr.AprSession session)
           
protected  boolean isInterestedInRead(org.apache.mina.transport.socket.apr.AprSession session)
          is this session registered for reading
protected  boolean isInterestedInWrite(org.apache.mina.transport.socket.apr.AprSession session)
          is this session registered for writing
protected  boolean isReadable(org.apache.mina.transport.socket.apr.AprSession session)
          Is the session ready for reading
protected  boolean isWritable(org.apache.mina.transport.socket.apr.AprSession session)
          Is the session ready for writing
protected  int read(org.apache.mina.transport.socket.apr.AprSession session, IoBuffer buffer)
           
protected  boolean select(int timeout)
          poll those sessions for the given timeout
protected  Iterator<org.apache.mina.transport.socket.apr.AprSession> selectedSessions()
           
protected  void setInterestedInRead(org.apache.mina.transport.socket.apr.AprSession session, boolean value)
          register a session for reading
protected  void setInterestedInWrite(org.apache.mina.transport.socket.apr.AprSession session, boolean value)
          register a session for writing
protected  AbstractPollingIoProcessor.SessionState state(org.apache.mina.transport.socket.apr.AprSession session)
           
protected  int transferFile(org.apache.mina.transport.socket.apr.AprSession session, FileRegion region, int length)
           
protected  void wakeup()
           
protected  int write(org.apache.mina.transport.socket.apr.AprSession session, IoBuffer buf, int length)
           
 
Methods inherited from class org.apache.mina.common.AbstractPollingIoProcessor
add, dispose, flush, isDisposed, isDisposing, remove, updateTrafficMask
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AprIoProcessor

public AprIoProcessor(Executor executor)
Method Detail

dispose0

protected void dispose0()
Specified by:
dispose0 in class AbstractPollingIoProcessor<org.apache.mina.transport.socket.apr.AprSession>

select

protected boolean select(int timeout)
                  throws Exception
Description copied from class: AbstractPollingIoProcessor
poll those sessions for the given timeout

Specified by:
select in class AbstractPollingIoProcessor<org.apache.mina.transport.socket.apr.AprSession>
Parameters:
timeout - milliseconds before the call timeout if no event appear
Returns:
true if at least a session is ready for read or for write
Throws:
Exception - if some low level IO error occurs

wakeup

protected void wakeup()
Specified by:
wakeup in class AbstractPollingIoProcessor<org.apache.mina.transport.socket.apr.AprSession>

allSessions

protected Iterator<org.apache.mina.transport.socket.apr.AprSession> allSessions()
Specified by:
allSessions in class AbstractPollingIoProcessor<org.apache.mina.transport.socket.apr.AprSession>

selectedSessions

protected Iterator<org.apache.mina.transport.socket.apr.AprSession> selectedSessions()
Specified by:
selectedSessions in class AbstractPollingIoProcessor<org.apache.mina.transport.socket.apr.AprSession>

init

protected void init(org.apache.mina.transport.socket.apr.AprSession session)
             throws Exception
Specified by:
init in class AbstractPollingIoProcessor<org.apache.mina.transport.socket.apr.AprSession>
Throws:
Exception

destroy

protected void destroy(org.apache.mina.transport.socket.apr.AprSession session)
                throws Exception
Specified by:
destroy in class AbstractPollingIoProcessor<org.apache.mina.transport.socket.apr.AprSession>
Throws:
Exception

state

protected AbstractPollingIoProcessor.SessionState state(org.apache.mina.transport.socket.apr.AprSession session)
Specified by:
state in class AbstractPollingIoProcessor<org.apache.mina.transport.socket.apr.AprSession>

isReadable

protected boolean isReadable(org.apache.mina.transport.socket.apr.AprSession session)
Description copied from class: AbstractPollingIoProcessor
Is the session ready for reading

Specified by:
isReadable in class AbstractPollingIoProcessor<org.apache.mina.transport.socket.apr.AprSession>
Parameters:
session - the session queried
Returns:
true is ready, false if not ready

isWritable

protected boolean isWritable(org.apache.mina.transport.socket.apr.AprSession session)
Description copied from class: AbstractPollingIoProcessor
Is the session ready for writing

Specified by:
isWritable in class AbstractPollingIoProcessor<org.apache.mina.transport.socket.apr.AprSession>
Parameters:
session - the session queried
Returns:
true is ready, false if not ready

isInterestedInRead

protected boolean isInterestedInRead(org.apache.mina.transport.socket.apr.AprSession session)
Description copied from class: AbstractPollingIoProcessor
is this session registered for reading

Specified by:
isInterestedInRead in class AbstractPollingIoProcessor<org.apache.mina.transport.socket.apr.AprSession>
Parameters:
session - the session queried
Returns:
true is registered for reading

isInterestedInWrite

protected boolean isInterestedInWrite(org.apache.mina.transport.socket.apr.AprSession session)
Description copied from class: AbstractPollingIoProcessor
is this session registered for writing

Specified by:
isInterestedInWrite in class AbstractPollingIoProcessor<org.apache.mina.transport.socket.apr.AprSession>
Parameters:
session - the session queried
Returns:
true is registered for writing

setInterestedInRead

protected void setInterestedInRead(org.apache.mina.transport.socket.apr.AprSession session,
                                   boolean value)
                            throws Exception
Description copied from class: AbstractPollingIoProcessor
register a session for reading

Specified by:
setInterestedInRead in class AbstractPollingIoProcessor<org.apache.mina.transport.socket.apr.AprSession>
Parameters:
session - the session registered
value - true for registering, false for removing
Throws:
Exception

setInterestedInWrite

protected void setInterestedInWrite(org.apache.mina.transport.socket.apr.AprSession session,
                                    boolean value)
                             throws Exception
Description copied from class: AbstractPollingIoProcessor
register a session for writing

Specified by:
setInterestedInWrite in class AbstractPollingIoProcessor<org.apache.mina.transport.socket.apr.AprSession>
Parameters:
session - the session registered
value - true for registering, false for removing
Throws:
Exception

read

protected int read(org.apache.mina.transport.socket.apr.AprSession session,
                   IoBuffer buffer)
            throws Exception
Specified by:
read in class AbstractPollingIoProcessor<org.apache.mina.transport.socket.apr.AprSession>
Throws:
Exception

write

protected int write(org.apache.mina.transport.socket.apr.AprSession session,
                    IoBuffer buf,
                    int length)
             throws Exception
Specified by:
write in class AbstractPollingIoProcessor<org.apache.mina.transport.socket.apr.AprSession>
Throws:
Exception

transferFile

protected int transferFile(org.apache.mina.transport.socket.apr.AprSession session,
                           FileRegion region,
                           int length)
                    throws Exception
Specified by:
transferFile in class AbstractPollingIoProcessor<org.apache.mina.transport.socket.apr.AprSession>
Throws:
Exception


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