Class DefaultConnectFuture

java.lang.Object
org.apache.mina.common.support.DefaultIoFuture
org.apache.mina.common.support.DefaultConnectFuture
All Implemented Interfaces:
ConnectFuture, IoFuture

public class DefaultConnectFuture extends DefaultIoFuture implements ConnectFuture
A default implementation of ConnectFuture.
  • Constructor Details

    • DefaultConnectFuture

      public DefaultConnectFuture()
      Creates a new instance.
    • DefaultConnectFuture

      public DefaultConnectFuture(Object lock)
      Creates a new instance which uses the specified object as a lock.
  • Method Details

    • newFailedFuture

      public static ConnectFuture newFailedFuture(Throwable exception)
      Returns a new ConnectFuture which is already marked as 'failed to connect'.
    • getSession

      public IoSession getSession() throws RuntimeIOException
      Description copied from interface: IoFuture
      Returns the IoSession which is associated with this future.
      Specified by:
      getSession in interface ConnectFuture
      Specified by:
      getSession in interface IoFuture
      Overrides:
      getSession in class DefaultIoFuture
      Returns:
      null if the connect operation is not finished yet
      Throws:
      RuntimeIOException - if connection attempt failed by an exception
    • isConnected

      public boolean isConnected()
      Description copied from interface: ConnectFuture
      Returns true if the connect operation is finished successfully.
      Specified by:
      isConnected in interface ConnectFuture
    • setSession

      public void setSession(IoSession session)
      Description copied from interface: ConnectFuture
      Sets the newly connected session and notifies all threads waiting for this future. This method is invoked by MINA internally. Please do not call this method directly.
      Specified by:
      setSession in interface ConnectFuture
    • setException

      public void setException(Throwable exception)
      Description copied from interface: ConnectFuture
      Sets the exception caught due to connection failure and notifies all threads waiting for this future. This method is invoked by MINA internally. Please do not call this method directly.
      Specified by:
      setException in interface ConnectFuture