salto.batch.lanceur.thread
Class BatchExecutionContext

java.lang.Object
  extended by salto.batch.lanceur.thread.BatchExecutionContext

public class BatchExecutionContext
extends java.lang.Object

Execution context of a Batch. It is created when the batch starts and can be used to communicate data between initialize, exec and finalizeBatch.
It also returns informations about current BatchStart...

Author:
Philippe Mouawad
See Also:
org.quartz.JobExecutionContext

Field Summary
static java.lang.String RETURN_STATUS_ATTRIBUTE
           
static java.lang.String START_WITH_PARAMETERS_ATTRIBUTE
           
 
Constructor Summary
BatchExecutionContext(JobExecutionContext context)
           
 
Method Summary
 void addException(java.lang.Throwable t)
          Add an exception to BatchExecutionContext
 java.lang.Object getAttribute(java.lang.String attributeName)
          Get value of attribute
 java.lang.String getBatchGroup()
           
 java.lang.Long getBatchId()
           
 java.lang.String getBatchName()
           
 java.util.Map getBatchParameters()
          Get parameters set through JMX, not parameters of SqlBatchStart
 java.lang.String getBatchStartDataSource()
           
static java.lang.String getBatchStartDataSource(JobExecutionContext theContext)
           
 SqlParameter[] getBatchStartParameters()
          Deprecated. use BatchExecutionContext#getBatchStartParameters()
 JobExecutionContext getContext()
          Internal method, do not use from client API
 java.util.List getExceptions()
          Returns exceptions stored in the context
static java.util.List getExceptions(JobExecutionContext theContext)
           
 java.lang.String getLaunchName()
           
 java.util.Map getPhysicalsFileNames()
          Deprecated. Added only for source compatibility with SI3SI, cannot be removed
 ReturnStatus getReturnStatus()
           
 SqlParameter[] getSqlBatchStartParameters()
          Modify parameters of BatchStart query.
 Trigger getTrigger()
           
 void removeAttribute(java.lang.String attributeName)
          Remvoe attribute
 void reset()
          Clean context
 void scheduleJob(Trigger trigger)
          Deprecated. DO NOT USE
 void setAttribute(java.lang.String attributeName, java.lang.Object value)
          Put attribute in context
 void setBatchId(java.lang.Long id)
           
 void setBatchParameters(java.util.Map params)
          Set parameters set through JMX, not parameters of SqlBatchStart
 void setBatchStartDataSource(java.lang.String dataSource)
           
 void setBatchStartParameters(SqlParameter[] parameters)
          Deprecated. use BatchExecutionContext#setBatchStartParameters(SqlParameter[])
 void setLaunchName(java.lang.String launchName)
           
 void setPhycalsFileNames(java.util.Map physicalsNames)
          Deprecated. Added only for source compatibility with SI3SI, cannot be removed
 void setPhysicalsFileNames(java.util.Map physicalsNames)
          Deprecated. Added only for source compatibility with SI3SI, cannot be removed
 void setReturnStatus(ReturnStatus status)
           
 void setSqlBatchStartParameters(SqlParameter[] parameters)
           
static boolean wasBatchExecutionVetoed(JobExecutionContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

START_WITH_PARAMETERS_ATTRIBUTE

public static final java.lang.String START_WITH_PARAMETERS_ATTRIBUTE
See Also:
Constant Field Values

RETURN_STATUS_ATTRIBUTE

public static final java.lang.String RETURN_STATUS_ATTRIBUTE
See Also:
Constant Field Values
Constructor Detail

BatchExecutionContext

public BatchExecutionContext(JobExecutionContext context)
Parameters:
context - JobExecutionContext
Method Detail

getBatchId

public final java.lang.Long getBatchId()
Returns:
long : id generated for the batch

setBatchId

public final void setBatchId(java.lang.Long id)
Parameters:
id - Long : id generated for the batch

addException

public final void addException(java.lang.Throwable t)
Add an exception to BatchExecutionContext

Parameters:
t - Throwable

getBatchParameters

public final java.util.Map getBatchParameters()
Get parameters set through JMX, not parameters of SqlBatchStart

Returns:
Map : Les paramètres du Batch (HashMap)

setBatchParameters

public final void setBatchParameters(java.util.Map params)
Set parameters set through JMX, not parameters of SqlBatchStart

Parameters:
params - Map : Les paramètres du Batch

getTrigger

public final Trigger getTrigger()
Returns:
Clone of the trigger

getExceptions

public final java.util.List getExceptions()
Returns exceptions stored in the context

Returns:
List of Throwable

getExceptions

public static final java.util.List getExceptions(JobExecutionContext theContext)
Parameters:
theContext - JobExecutionContext
Returns:
List of Throwable

setBatchStartDataSource

public final void setBatchStartDataSource(java.lang.String dataSource)
Parameters:
dataSource - String pool name for IBatchStart

getBatchStartDataSource

public final java.lang.String getBatchStartDataSource()
Returns:
String pool name for IBatchStart

setLaunchName

public final void setLaunchName(java.lang.String launchName)
Parameters:
launchName - String launch name

getLaunchName

public final java.lang.String getLaunchName()
Returns:
String Launch name if batch has launches

getBatchGroup

public final java.lang.String getBatchGroup()
Returns:
String Name of Batch Group

getBatchName

public final java.lang.String getBatchName()
Returns:
String Name of Batch

setReturnStatus

public final void setReturnStatus(ReturnStatus status)
Parameters:
status - ReturnStatus : return status

getReturnStatus

public final ReturnStatus getReturnStatus()
Returns:
ReturnStatus

getBatchStartDataSource

public static final java.lang.String getBatchStartDataSource(JobExecutionContext theContext)
Parameters:
theContext - JobExecutionContext
Returns:
String name of pool used by IBatchStart

reset

public final void reset()
Clean context


setAttribute

public final void setAttribute(java.lang.String attributeName,
                               java.lang.Object value)
Put attribute in context

Parameters:
attributeName - Name of attribute
value - Object to store

getAttribute

public final java.lang.Object getAttribute(java.lang.String attributeName)
Get value of attribute

Parameters:
attributeName - Nom de l'attribut
Returns:
Object

removeAttribute

public final void removeAttribute(java.lang.String attributeName)
Remvoe attribute

Parameters:
attributeName - Name of attribute to remove

wasBatchExecutionVetoed

public static final boolean wasBatchExecutionVetoed(JobExecutionContext context)
Parameters:
context - JobExecutionContext
Returns:
boolean

setSqlBatchStartParameters

public void setSqlBatchStartParameters(SqlParameter[] parameters)
Parameters:
parameters - SqlParameter[]

setBatchStartParameters

public void setBatchStartParameters(SqlParameter[] parameters)
Deprecated. use BatchExecutionContext#setBatchStartParameters(SqlParameter[])

Same code as BatchExecutionContext#setBatchStartParameters(SqlParameter[])

Parameters:
parameters - SqlParameter[]
See Also:
setBatchStartParameters(SqlParameter[])

getSqlBatchStartParameters

public SqlParameter[] getSqlBatchStartParameters()
Modify parameters of BatchStart query.

Returns:
SqlParameter[] of BatchStart or null if not set

getBatchStartParameters

public SqlParameter[] getBatchStartParameters()
Deprecated. use BatchExecutionContext#getBatchStartParameters()

Same code as BatchExecutionContext#getBatchStartParameters()

Returns:
SqlParameter[] of BatchStart or null if not set
See Also:
getBatchStartParameters()

getPhysicalsFileNames

public final java.util.Map getPhysicalsFileNames()
Deprecated. Added only for source compatibility with SI3SI, cannot be removed

Returns:
Map : Les noms physiques des fichiers (HashMap)

setPhycalsFileNames

public final void setPhycalsFileNames(java.util.Map physicalsNames)
Deprecated. Added only for source compatibility with SI3SI, cannot be removed

Use setAttribute

Parameters:
physicalsNames - Map physical file names

setPhysicalsFileNames

public final void setPhysicalsFileNames(java.util.Map physicalsNames)
Deprecated. Added only for source compatibility with SI3SI, cannot be removed

Parameters:
physicalsNames - Map physical file names
See Also:
setAttribute(String, Object)

scheduleJob

public void scheduleJob(Trigger trigger)
Deprecated. DO NOT USE

This method throws an exception

Parameters:
trigger - Trigger

getContext

public JobExecutionContext getContext()
Internal method, do not use from client API

Returns:
JobExecutionContext


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