magoffin.matt.ma2.biz
Interface WorkBiz.WorkRequest

All Known Subinterfaces:
IOBiz.TwoPhaseExportRequest
Enclosing interface:
WorkBiz

public static interface WorkBiz.WorkRequest

Interface for submitting a job to the work queue.


Method Summary
 boolean canStart()
          Return boolean indicator if this work is ready to be started.
 float getAmountCompleted()
          Get the amount of work that has been completed, from 0 to 1.
 java.lang.String getDisplayName()
          Get a display name for this work request.
 java.lang.String getMessage()
          Get a message to pass to the result work info.
 java.util.List<java.lang.Long> getObjectIdList()
          Get a List to use for holding object IDs.
 java.lang.Integer getPriority()
          Get a priority for the work.
 boolean isTransactional()
          Return boolean flag indicating if this work request requires a transaction or not.
 void startWork()
          Start performing the work.
 

Method Detail

getDisplayName

java.lang.String getDisplayName()
Get a display name for this work request.

Returns:
display name

getMessage

java.lang.String getMessage()
Get a message to pass to the result work info.

Returns:
message

getPriority

java.lang.Integer getPriority()
Get a priority for the work.

Returns:
the priority

canStart

boolean canStart()
Return boolean indicator if this work is ready to be started.

Some work requests might have dependancies on other tasks. This method allows a work request to inform the WorkBiz if this task can be started. If not, the WorkBiz will schedule the task to be run only after this method returns true.

Returns:
boolean

startWork

void startWork()
               throws java.lang.Exception
Start performing the work.

Throws:
java.lang.Exception - if an error occurs

getAmountCompleted

float getAmountCompleted()
Get the amount of work that has been completed, from 0 to 1.

Returns:
the amount of work completed, as a fraction from 0 to 1

getObjectIdList

java.util.List<java.lang.Long> getObjectIdList()
Get a List to use for holding object IDs.

Returns:
a List, or null if not used

isTransactional

boolean isTransactional()
Return boolean flag indicating if this work request requires a transaction or not.

Returns:
boolean