Class AprSession

java.lang.Object
org.apache.mina.core.session.AbstractIoSession
org.apache.mina.transport.socket.apr.AprSession
All Implemented Interfaces:
IoSession
Direct Known Subclasses:
AprDatagramSession, AprSocketSession

public abstract class AprSession extends AbstractIoSession
An abstract IoSession serving of base for APR based sessions.
  • Field Details

    • descriptor

      private long descriptor
    • processor

      private final IoProcessor<AprSession> processor
    • filterChain

      private final IoFilterChain filterChain
    • remoteAddress

      private final InetSocketAddress remoteAddress
    • localAddress

      private final InetSocketAddress localAddress
    • readable

      private boolean readable
    • writable

      private boolean writable
    • interestedInRead

      private boolean interestedInRead
    • interestedInWrite

      private boolean interestedInWrite
  • Constructor Details

  • Method Details

    • getDescriptor

      long getDescriptor()
      Get the socket descriptor @see Socket#create(int, int, int, long).
      Returns:
      the low level APR socket descriptor
    • setDescriptor

      void setDescriptor(long desc)
      Set the socket descriptor.
      Parameters:
      desc - the low level APR socket descriptor created by @see Socket#create(int, int, int, long)
    • getProcessor

      public IoProcessor<AprSession> getProcessor()
      Specified by:
      getProcessor in class AbstractIoSession
      Returns:
      The associated IoProcessor for this session
    • getLocalAddress

      public InetSocketAddress getLocalAddress()
      Returns:
      the socket address of local machine which is associated with this session.
    • getRemoteAddress

      public InetSocketAddress getRemoteAddress()
      Returns:
      the socket address of remote peer.
    • getFilterChain

      public IoFilterChain getFilterChain()
      Returns:
      the filter chain that only affects this session.
    • getServiceAddress

      public InetSocketAddress getServiceAddress()
      Specified by:
      getServiceAddress in interface IoSession
      Overrides:
      getServiceAddress in class AbstractIoSession
      Returns:
      the socket address of the IoService listens to to manage this session. If this session is managed by IoAcceptor, it returns the SocketAddress which is specified as a parameter of IoAcceptor.bind(). If this session is managed by IoConnector, this method returns the same address with that of IoSession.getRemoteAddress().
    • isReadable

      boolean isReadable()
      Is this session was tagged are readable after a call to Socket.pool(long).
      Returns:
      true if this session is ready for read operations
    • setReadable

      void setReadable(boolean readable)
      Set if this session is readable after a call to Socket.pool(long).
      Parameters:
      readable - true for set this session ready for read operations
    • isWritable

      boolean isWritable()
      Is this session is tagged writable after a call to Socket.pool(long).
      Returns:
      true if this session is ready for write operations
    • setWritable

      void setWritable(boolean writable)
      Set if this session is writable after a call to Socket.pool(long).
      Parameters:
      writable - true for set this session ready for write operations
    • isInterestedInRead

      boolean isInterestedInRead()
      Does this session needs to be registered for read events. Used for building poll set @see Poll.
      Returns:
      true if registered
    • setInterestedInRead

      void setInterestedInRead(boolean isOpRead)
      Set if this session needs to be registered for read events. Used for building poll set @see Poll.
      Parameters:
      isOpRead - true if need to be registered
    • isInterestedInWrite

      boolean isInterestedInWrite()
      Does this session needs to be registered for write events. Used for building poll set @see Poll.
      Returns:
      true if registered
    • setInterestedInWrite

      void setInterestedInWrite(boolean isOpWrite)
      Set if this session needs to be registered for write events. Used for building poll set @see Poll.
      Parameters:
      isOpWrite - true if need to be registered