Class DefaultIoFuture

java.lang.Object
org.apache.mina.common.support.DefaultIoFuture
All Implemented Interfaces:
IoFuture
Direct Known Subclasses:
DefaultCloseFuture, DefaultConnectFuture, DefaultWriteFuture

public class DefaultIoFuture extends Object implements IoFuture
A default implementation of IoFuture.
  • Constructor Details

    • DefaultIoFuture

      public DefaultIoFuture(IoSession session)
      Creates a new instance.
      Parameters:
      session - an IoSession which is associated with this future
    • DefaultIoFuture

      public DefaultIoFuture(IoSession session, Object lock)
      Creates a new instance.
      Parameters:
      session - an IoSession which is associated with this future
  • Method Details

    • getSession

      public IoSession getSession()
      Description copied from interface: IoFuture
      Returns the IoSession which is associated with this future.
      Specified by:
      getSession in interface IoFuture
    • getLock

      public Object getLock()
      Description copied from interface: IoFuture
      Returns the lock object this future acquires.
      Specified by:
      getLock in interface IoFuture
    • join

      public void join()
      Description copied from interface: IoFuture
      Wait for the asynchronous operation to end.
      Specified by:
      join in interface IoFuture
    • join

      public boolean join(long timeoutMillis)
      Description copied from interface: IoFuture
      Wait for the asynchronous operation to end with the specified timeout.
      Specified by:
      join in interface IoFuture
      Returns:
      true if the operation is finished.
    • isReady

      public boolean isReady()
      Description copied from interface: IoFuture
      Returns if the asynchronous operation is finished.
      Specified by:
      isReady in interface IoFuture
    • setValue

      protected void setValue(Object newValue)
      Sets the result of the asynchronous operation, and mark it as finished.
    • getValue

      protected Object getValue()
      Returns the result of the asynchronous operation.
    • addListener

      public void addListener(IoFutureListener listener)
      Description copied from interface: IoFuture
      Adds an event listener which is notified when the state of this future changes.
      Specified by:
      addListener in interface IoFuture
    • removeListener

      public void removeListener(IoFutureListener listener)
      Description copied from interface: IoFuture
      Removes an existing event listener which is notified when the state of this future changes.
      Specified by:
      removeListener in interface IoFuture