|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.equilibrium.util.api.MGBatch
public class MGBatch
Handle creation and submission of Batches. A batch is a sequence of MediaRich requests called Jobs. Each batch is assigned a unique id, the BatchId. Each job within a batch is also assigned a JobId.
Additionally, the MGBatch object can submit an ErrorJob. This job consists of a script to be executed whenever an uncaught exception is thrown within any job.req object such as getJobId, getJobTempDir,
getBatchId and getBatchTempDir. Those methods are documented in the
MediaRich Programmers Guide.
As mentioned above as part of an ErrorJob an error script may be executed. This script is
passed all of the parameters of the job that had an error, prefixed with "ScriptParam_".
The file parameter paths are passed to the error script, prefixed with "FileParam_".
The following parameters are also passed:
req object.
| Method Summary | |
|---|---|
void |
commit()
Commit the batch after all jobs have been submitted. |
MGRequest |
createErrorScriptRequest()
Create a request for an error job for this batch. |
MGRequest |
createJobRequest()
Create a normal job request. |
MGRequest |
createJobRequest(boolean block,
boolean waitPrev,
boolean holdSub)
Return a new job request, specifying if the job should block the thread, wait for previous jobs to complete or hold subsequent jobs until this job completes. |
MGRequest |
createPostscriptRequest()
Create a postscript job request. |
MGRequest |
createPrescriptRequest()
Create a prescript request. |
void |
discard()
Discard this batch. |
int |
getID()
Return the batch id for this batch. |
long |
getMgSessionId()
Return the MG Session ID for this batch |
MGFileResponse |
requestFile(java.lang.String path)
Request a file generated during this batch. |
void |
setBatchInfo(java.lang.String info)
Set an info string for this batch. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public int getID()
public long getMgSessionId()
public MGRequest createErrorScriptRequest()
throws java.io.IOException,
MGException
java.io.IOException
MGException
public MGRequest createPrescriptRequest()
throws java.io.IOException,
MGException
java.io.IOException
MGException
public MGRequest createJobRequest()
throws java.io.IOException,
MGException
java.io.IOException
MGException
public MGRequest createJobRequest(boolean block,
boolean waitPrev,
boolean holdSub)
throws java.io.IOException,
MGException
block - set true for the commit for this request to block the thread until the job completes.waitPrev - set true to cause this job to wait until all previous jobs have completed prior to executing.holdSub - set true to hold all subsequently submitted jobs until this job completes.
java.io.IOException
MGException
public MGRequest createPostscriptRequest()
throws java.io.IOException,
MGException
java.io.IOException
MGException
public void setBatchInfo(java.lang.String info)
throws java.io.IOException,
MGException
info - The info string to assign to this batch.
java.io.IOException
MGException
public MGFileResponse requestFile(java.lang.String path)
throws java.io.IOException,
MGException
path - virtual path of requested file.
java.io.IOException
MGException
public void discard()
throws java.io.IOException
java.io.IOException
public void commit()
throws java.io.IOException,
MGException
java.io.IOException
MGException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||