org.apache.mina.common.support
Class DefaultIoFuture

java.lang.Object
  extended by org.apache.mina.common.support.DefaultIoFuture
All Implemented Interfaces:
org.apache.mina.common.IoFuture

public class DefaultIoFuture
extends Object
implements org.apache.mina.common.IoFuture

A default implementation of IoFuture.


Constructor Summary
DefaultIoFuture(org.apache.mina.common.IoSession session)
          Creates a new instance.
DefaultIoFuture(org.apache.mina.common.IoSession session, Object lock)
          Creates a new instance which uses the specified object as a lock.
 
Method Summary
 void addListener(org.apache.mina.common.IoFutureListener listener)
           
 Object getLock()
           
 org.apache.mina.common.IoSession getSession()
           
protected  Object getValue()
          Returns the result of the asynchronous operation.
 boolean isReady()
           
 void join()
           
 boolean join(long timeoutInMillis)
           
 void removeListener(org.apache.mina.common.IoFutureListener listener)
           
protected  void setValue(Object newValue)
          Sets the result of the asynchronous operation, and mark it as finished.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultIoFuture

public DefaultIoFuture(org.apache.mina.common.IoSession session)
Creates a new instance.

Parameters:
session - an IoSession which is associated with this future

DefaultIoFuture

public DefaultIoFuture(org.apache.mina.common.IoSession session,
                       Object lock)
Creates a new instance which uses the specified object as a lock.

Method Detail

getSession

public org.apache.mina.common.IoSession getSession()
Specified by:
getSession in interface org.apache.mina.common.IoFuture

getLock

public Object getLock()
Specified by:
getLock in interface org.apache.mina.common.IoFuture

join

public void join()
Specified by:
join in interface org.apache.mina.common.IoFuture

join

public boolean join(long timeoutInMillis)
Specified by:
join in interface org.apache.mina.common.IoFuture

isReady

public boolean isReady()
Specified by:
isReady in interface org.apache.mina.common.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(org.apache.mina.common.IoFutureListener listener)
Specified by:
addListener in interface org.apache.mina.common.IoFuture

removeListener

public void removeListener(org.apache.mina.common.IoFutureListener listener)
Specified by:
removeListener in interface org.apache.mina.common.IoFuture


Licensed to the Apache Software Foundation