|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsalto.batch.lanceur.thread.Traitement
public abstract class Traitement
Base class of a Batch.
Subclasses will typically implement:
Traitement#initialize() to do some job before getting data, this method is called in Monothreaded modeTraitement#exec(Object[]) to call the business classes that do the Job on the Data, this method is called in Multi threaded mode if batch is multi threadedTraitement#finalizeBatch() to do some job after all data have been treated, this method is called in Monothreaded mode
BaseBatch} is the prefered Class since signature of methods is clear.| Field Summary | |
|---|---|
protected IBatchAppender |
batchAppender
Appender used to log executions of batch |
| Constructor Summary | |
|---|---|
Traitement()
|
|
| Method Summary | |
|---|---|
boolean |
canExec(java.lang.Object[] dataEnCours,
java.lang.Object[] data)
Called before execution of Traitement#exec(Object[]). |
protected Traitement |
childClone(Traitement clone)
Clone method for Traitement. |
java.lang.Object |
clone()
Clones the Traitement |
abstract void |
exec(java.lang.Object[] data)
Implement this method to execute the business code on the Block of data PART OF PUBLIC API |
void |
execute(long numJob,
java.lang.Object[] data,
java.lang.String ids)
Called to execute a Job |
void |
finalizeBatch()
Called when batch has finished treating all data or has encountered an error. |
BatchExecutionContext |
getBatchExecutionContext()
Get access to BatchExecutionContext one per execution
PART OF PUBLIC API |
protected java.util.Map |
getBatchParameters()
Deprecated. use getBatchExecutionContext() |
protected java.util.Map |
getBatchPhysicalsFileNames()
Deprecated. use getBatchExecutionContext() |
void |
initialize()
Called when batch is triggered. |
void |
postExec(long numJob,
java.lang.Object[] data,
java.lang.Object ids,
java.lang.Throwable ex)
NOT PART OF PUBLIC API Called after execution of exec |
void |
preExec(long numJob,
java.lang.Object[] data,
java.lang.Object ids)
NOT PART OF PUBLIC API Called after execution on a block of data. |
void |
setBatchAppender(IBatchAppender batchAppenderToClone)
Initialize Appender. |
protected void |
setReturnStatus(int codeValue,
java.lang.String message)
Method that call IReturnStatusSystem service qui to create the Return code
and stores it in BatchExecutionContext |
void |
vetoExecution(java.lang.String message)
Stop batch execution from initialize PART OF PUBLIC API |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected transient IBatchAppender batchAppender
| Constructor Detail |
|---|
public Traitement()
| Method Detail |
|---|
public final void execute(long numJob,
java.lang.Object[] data,
java.lang.String ids)
throws BatchException
numJob - Job numberdata - Object[] dataids - String Ids
BatchException
public void preExec(long numJob,
java.lang.Object[] data,
java.lang.Object ids)
numJob - Job Iddata - Object[]ids - Ids of data
public void postExec(long numJob,
java.lang.Object[] data,
java.lang.Object ids,
java.lang.Throwable ex)
numJob - data - ids - ex -
public abstract void exec(java.lang.Object[] data)
throws java.lang.Exception
data - Object[] Array of Data as specified by IBatchStart
java.lang.Exception
public final void vetoExecution(java.lang.String message)
throws VetoBatchExecutionException
message - Explanation message, may be null
VetoBatchExecutionException
public boolean canExec(java.lang.Object[] dataEnCours,
java.lang.Object[] data)
Traitement#exec(Object[]).
dataEnCours - Data currently treated by concurrent threads of the batchdata - New block of data
public final java.lang.Object clone()
throws java.lang.CloneNotSupportedException
Traitement
clone in class java.lang.Objectjava.lang.CloneNotSupportedException
protected Traitement childClone(Traitement clone)
throws java.lang.CloneNotSupportedException
Traitement.
clone - Traitement to clone
java.lang.CloneNotSupportedExceptionpublic final void setBatchAppender(IBatchAppender batchAppenderToClone)
IBatchAppender must be thread-safe.
batchAppenderToClone - IBatchAppender
public void initialize()
throws java.lang.Exception
IBatchStart.
java.lang.Exceptionpublic void finalizeBatch()
public final BatchExecutionContext getBatchExecutionContext()
BatchExecutionContext one per execution
PART OF PUBLIC API
protected final void setReturnStatus(int codeValue,
java.lang.String message)
IReturnStatusSystem service qui to create the Return code
and stores it in BatchExecutionContext
codeValue - int Return code valuemessage - String Message to display for return codeprotected final java.util.Map getBatchParameters()
getBatchExecutionContext()
BatchExecutionContext.getBatchParameters(),
getBatchExecutionContext()protected final java.util.Map getBatchPhysicalsFileNames()
getBatchExecutionContext()
Map of logical/physical file names for batch
Map of logical/physical file names for batch
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||