FileDocCategorySizeDatePackage
FutureStub.javaAPI DocApache Lucene 2.1.02742Wed Feb 14 10:46:02 GMT 2007org.apache.lucene.gdata.search.index

FutureStub

public class FutureStub extends Object implements Future
author
Simon Willnauer

Fields Summary
T
object
CountDownLatch
latch
boolean
wait
Constructors Summary
public FutureStub(T returnObject, CountDownLatch latch)

        this(returnObject,latch,false);
    
public FutureStub(T returnObject, CountDownLatch latch, boolean wait)

        super();
        this.object = returnObject;
        this.latch =latch;
        this.wait =wait;
    
public FutureStub(T returnObject)

        this(returnObject,null);
    
Methods Summary
public booleancancel(boolean arg0)

see
java.util.concurrent.Future#cancel(boolean)


        return false;
    
private voiddoLatch()

        if(latch != null){
            if(!wait)
            this.latch.countDown();
            else
                this.latch.await(5000,TimeUnit.MILLISECONDS);
        }
    
public Tget()

see
java.util.concurrent.Future#get()

        doLatch(); 
        return this.object;
    
public Tget(long arg0, java.util.concurrent.TimeUnit arg1)

see
java.util.concurrent.Future#get(long, java.util.concurrent.TimeUnit)

       doLatch();
        return this.object;
    
public booleanisCancelled()

see
java.util.concurrent.Future#isCancelled()


        return false;
    
public booleanisDone()

see
java.util.concurrent.Future#isDone()


        return true;