org.openrdf.http.object.tasks
Class Task

java.lang.Object
  extended by org.openrdf.http.object.tasks.Task
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
ProcessTask, TriageTask, VerifyTask

public abstract class Task
extends Object
implements Runnable

A step for handling a request that can be performed in isolation.

Author:
James Leigh

Constructor Summary
Task(Request request, Filter filter)
           
 
Method Summary
 void abort()
           
 void awaitVerification(long time, TimeUnit unit)
           
<T extends Task>
T
bear(T child)
           
 void close()
           
abstract  int getGeneration()
           
 org.apache.http.HttpResponse getHttpResponse()
           
 long getReceivedOn()
           
 void go(Executor executor)
           
 boolean isDone()
           
 boolean isSafe()
           
 boolean isStorable()
           
 void onDone(Runnable onDone)
           
 void run()
           
 void setTrigger(org.apache.http.nio.protocol.NHttpResponseTrigger trigger)
           
 void submitResponse(org.apache.http.HttpResponse response)
           
 void submitResponse(Response resp)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Task

public Task(Request request,
            Filter filter)
Method Detail

isStorable

public final boolean isStorable()

isSafe

public final boolean isSafe()

getReceivedOn

public final long getReceivedOn()

setTrigger

public void setTrigger(org.apache.http.nio.protocol.NHttpResponseTrigger trigger)

run

public void run()
Specified by:
run in interface Runnable

getGeneration

public abstract int getGeneration()

bear

public <T extends Task> T bear(T child)

go

public void go(Executor executor)

isDone

public boolean isDone()

awaitVerification

public void awaitVerification(long time,
                              TimeUnit unit)
                       throws InterruptedException
Throws:
InterruptedException

abort

public void abort()

close

public void close()

onDone

public void onDone(Runnable onDone)

getHttpResponse

public org.apache.http.HttpResponse getHttpResponse()
                                             throws org.apache.http.HttpException,
                                                    IOException
Throws:
org.apache.http.HttpException
IOException

submitResponse

public void submitResponse(Response resp)
                    throws Exception
Throws:
Exception

submitResponse

public void submitResponse(org.apache.http.HttpResponse response)
                    throws IOException
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2010 James Leigh Services Inc.. All Rights Reserved.