atg.repository.loader
Interface ErrorPolicy


public interface ErrorPolicy

An ErrorPolicy defines the way in which a Job handles errors encountered when processing files for the Repository Loader.

For each exception encountered by the Repository Loader the configured ErrorPolicy components will be called in a specific order and under specific circumstances.

  1. When an exception is first encountered the RL will pass it to the configured ErrorPolicy's checkIsExceptionFatal() method. If this method returns true the job will stop processing immediately.
  2. If this method returns false, the RL will then call checkRequiresNewTransaction. If this returns false the RL will continue to process the current Batch using the existing transaction. If this returns true the RL will end the current transaction and batch and create a new transaction and batch and continue processing the job starting with the next file in the job.

When the RL goes to end a transaction for a Batch is calls the ErrorPolicy component's checkEndTransactionWithBatchState() method to determine if it should use the state of the Job or the state of the Batch to decide how to end the transaction.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Method Summary
 boolean checkEndTransactionWithBatchState()
          Returns true if transaction demarcations should be ended using the state of the Job's current Batch.
 boolean checkIsExceptionFatal(java.lang.Throwable pException)
          Returns true if the provided exception should terminate processing of a job.
 boolean checkRequiresNewTransaction(java.lang.Throwable pException)
          Returns true if the provided exception requires a new transaction in order for the job to reasonably continue.
 ApplicationLogging getApplicationLogging()
          Returns the optional component handling logging functions
 void setApplicationLogging(ApplicationLogging pApplicationLogging)
          Sets the optional component handling logging functions
 

Field Detail

CLASS_VERSION

static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values
Method Detail

setApplicationLogging

void setApplicationLogging(ApplicationLogging pApplicationLogging)
Sets the optional component handling logging functions


getApplicationLogging

ApplicationLogging getApplicationLogging()
Returns the optional component handling logging functions


checkIsExceptionFatal

boolean checkIsExceptionFatal(java.lang.Throwable pException)
Returns true if the provided exception should terminate processing of a job. False if the job can continue.


checkRequiresNewTransaction

boolean checkRequiresNewTransaction(java.lang.Throwable pException)
Returns true if the provided exception requires a new transaction in order for the job to reasonably continue. False if the current transaction can still be used. A SQLException, for example, will usually require a new transaction while an XML processing exception generally may not.


checkEndTransactionWithBatchState

boolean checkEndTransactionWithBatchState()
Returns true if transaction demarcations should be ended using the state of the Job's current Batch. Otherwise use the value of the Job's jobFailed property. Using the former is more optimistic since an error in any previous Batch will mark the Job as failed. The latter will allow a successful Batch to avoid rolling back even if a previous Batch failed. Users should return true with great caution, particularly where dependencies exist between loaded data.