com.ubikingenierie.console.apiconsole
Class BaseBatch

java.lang.Object
  extended by salto.batch.lanceur.thread.Traitement
      extended by com.ubikingenierie.console.apiconsole.BaseBatch
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
BaseJmsBatch

public abstract class BaseBatch
extends Traitement

Base class for Batches, subclasses will implement:

Since:
5.0.0.0
Author:
Philippe Mouawad

Field Summary
 
Fields inherited from class salto.batch.lanceur.thread.Traitement
batchAppender
 
Constructor Summary
BaseBatch()
           
 
Method Summary
 boolean canExec(java.lang.Object[] dataEnCours, java.lang.Object[] data)
          Called before execution of Traitement#Traitement.exec(Object[]).
protected  Traitement childClone(Traitement clone)
          Clone method for Traitement.
abstract  TraitementConfiguration createConfiguration()
          Method used to create a Batch configuration
 void exec(java.lang.Object[] data)
          Implement this method to execute the business code on the Block of data
protected abstract  void executeAfterDataEnd()
          Called when batch has finished treating all data or has encountered an error.
protected abstract  void executeBeforeData()
          Called when batch is triggered.
protected abstract  void executeOnBlock(java.lang.Object[] data)
          Implement this method to execute the business code on the Block of data
 void finalizeBatch()
          Called when batch has finished treating all data or has encountered an error.
 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.
 
Methods inherited from class salto.batch.lanceur.thread.Traitement
clone, execute, getBatchExecutionContext, getBatchParameters, getBatchPhysicalsFileNames, setBatchAppender, setReturnStatus, vetoExecution
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseBatch

public BaseBatch()
Method Detail

executeOnBlock

protected abstract void executeOnBlock(java.lang.Object[] data)
                                throws java.lang.Exception
Implement this method to execute the business code on the Block of data

Parameters:
data - Object[] Array of Data as specified by IBatchStart
Throws:
java.lang.Exception

executeBeforeData

protected abstract void executeBeforeData()
                                   throws java.lang.Exception
Called when batch is triggered.
. It is called in mono-threaded mode and before data has been extracted from IBatchStart.
Default implementatin is NOOP. PART OF PUBLIC API

Throws:
java.lang.Exception

executeAfterDataEnd

protected abstract void executeAfterDataEnd()
                                     throws java.lang.Exception
Called when batch has finished treating all data or has encountered an error.
. It is called in mono-threaded mode.
Default implementatin is NOOP.

Throws:
java.lang.Exception

initialize

public final void initialize()
                      throws java.lang.Exception
Description copied from class: Traitement
Called when batch is triggered.
. It is called in mono-threaded mode and before data has been extracted from IBatchStart.
Default implementatin is NOOP. PART OF PUBLIC API

Overrides:
initialize in class Traitement
Throws:
java.lang.Exception
See Also:
Traitement.initialize()

finalizeBatch

public final void finalizeBatch()
Description copied from class: Traitement
Called when batch has finished treating all data or has encountered an error.
. It is called in mono-threaded mode.
Default implementatin is NOOP. PART OF PUBLIC API

Overrides:
finalizeBatch in class Traitement
See Also:
Traitement.finalizeBatch()

exec

public final void exec(java.lang.Object[] data)
                throws java.lang.Exception
Implement this method to execute the business code on the Block of data

Specified by:
exec in class Traitement
Parameters:
data - Object[] Array of Data as specified by IBatchStart
Throws:
java.lang.Exception
See Also:
Traitement.exec(java.lang.Object[])

canExec

public final boolean canExec(java.lang.Object[] dataEnCours,
                             java.lang.Object[] data)
Description copied from class: Traitement
Called before execution of Traitement#Traitement.exec(Object[]).
Implement if you have some business rule that forbides executing (in case of multithreaded batch) same treatment on related datas.

Overrides:
canExec in class Traitement
Parameters:
dataEnCours - Data currently treated by concurrent threads of the batch
data - New block of data
Returns:
boolean true if execution can happen(defaults to true)
See Also:
Traitement.canExec(java.lang.Object[], java.lang.Object[])

postExec

public final void postExec(long numJob,
                           java.lang.Object[] data,
                           java.lang.Object ids,
                           java.lang.Throwable ex)
Description copied from class: Traitement
NOT PART OF PUBLIC API Called after execution of exec

Overrides:
postExec in class Traitement
See Also:
Traitement.postExec(long, java.lang.Object[], java.lang.Object, java.lang.Throwable)

preExec

public final void preExec(long numJob,
                          java.lang.Object[] data,
                          java.lang.Object ids)
Description copied from class: Traitement
NOT PART OF PUBLIC API Called after execution on a block of data.

Overrides:
preExec in class Traitement
Parameters:
numJob - Job Id
data - Object[]
ids - Ids of data
See Also:
Traitement.preExec(long, java.lang.Object[], java.lang.Object)

childClone

protected Traitement childClone(Traitement clone)
                         throws java.lang.CloneNotSupportedException
Description copied from class: Traitement
Clone method for Traitement.
Default implementation throws CloneNotSupportedException NOT PART OF PUBLIC API

Overrides:
childClone in class Traitement
Parameters:
clone - Traitement to clone
Returns:
Traitement
Throws:
java.lang.CloneNotSupportedException
See Also:
Traitement.childClone(salto.batch.lanceur.thread.Traitement)

createConfiguration

public abstract TraitementConfiguration createConfiguration()
                                                     throws BatchException
Method used to create a Batch configuration

Returns:
TraitementConfiguration Configuration of Batch
Throws:
BatchException


Copyright © 2005-2008 Ubik-Ingenierie. All Rights Reserved.