rice.environment.processing
Class WorkRequest<R>
java.lang.Object
rice.environment.processing.WorkRequest<R>
- All Implemented Interfaces:
- java.lang.Runnable, Cancellable
public abstract class WorkRequest<R>
- extends java.lang.Object
- implements java.lang.Runnable, Cancellable
Extend this class and implement doWork() if you need to do blocking disk IO.
This is primarily used by Persistence.
- Author:
- Jeff Hoye
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cancelled
protected boolean cancelled
running
protected boolean running
WorkRequest
public WorkRequest(Continuation<R,java.lang.Exception> c,
SelectorManager sm)
WorkRequest
public WorkRequest()
returnResult
public void returnResult(R o)
returnError
public void returnError(java.lang.Exception e)
run
public void run()
- Specified by:
run
in interface java.lang.Runnable
cancel
public boolean cancel()
- Specified by:
cancel
in interface Cancellable
- Returns:
- true if it was cancelled, false if it was already complete, or cancelled.
doWork
public abstract R doWork()
throws java.lang.Exception
- Throws:
java.lang.Exception
Copyright © 2001-2005 - Rice Pastry.