|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface WorkBiz
API for a work queue and scheduling tasks to keep the application from overloading the system it's running on.
Nested Class Summary | |
---|---|
static interface |
WorkBiz.WorkInfo
Work information created by submitting WorkRequest instances. |
static interface |
WorkBiz.WorkRequest
Interface for submitting a job to the work queue. |
Field Summary | |
---|---|
static java.lang.Integer |
DEFAULT_PRIORITY
The default priority applied to work requests if none specified. |
static java.lang.Integer |
HIGH_PRIORITY
A high priority. |
static java.lang.Integer |
LOW_PRIORITY
A low priority. |
Method Summary | |
---|---|
WorkBiz.WorkInfo |
getInfo(long ticket)
Get information about a running or recently running job. |
boolean |
infoExists(long ticket)
Check for the existance of a running or recently complete job. |
WorkBiz.WorkInfo |
submitWork(WorkBiz.WorkRequest work)
Submit a work request for processing. |
boolean |
workReadyNow(long ticket)
Signal that a particular job is ready to begin work now, presumably after being delayed. |
Field Detail |
---|
static final java.lang.Integer DEFAULT_PRIORITY
static final java.lang.Integer LOW_PRIORITY
static final java.lang.Integer HIGH_PRIORITY
Method Detail |
---|
WorkBiz.WorkInfo submitWork(WorkBiz.WorkRequest work)
work
- the work to perform
WorkBiz.WorkInfo getInfo(long ticket)
If the job is still running calling this method must always return the work info. If the job has completed, it is up to the implementation of this API if the info is returned or not. For practical purposes implementations should be able to return information about completed jobs for a reasonable length of time after the job completes, to give time for clients to query the status of the job.
Note: calling this method might have side effects,
like purging completed jobs. Use the infoExists(long)
method to test for the existance of a job without any of these
potential side effects.
ticket
- the work ticket number
boolean infoExists(long ticket)
This method can be used to check if a job is known, without
any side-effects calling getInfo(long)
might include (such as
resetting access statitics, purging a complete job, etc).
ticket
- the work ticket number
boolean workReadyNow(long ticket)
ticket
- the work ticket number that is ready
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |