com.rhi.architecture.parc.adapter
Class OutputRecordsTask

java.lang.Object
  extended bycom.rhi.architecture.parc.adapter.OutputRecordsTask
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Runnable
Direct Known Subclasses:
ErrorRecordsTask, ValidRecordsTask

public abstract class OutputRecordsTask
extends java.lang.Object
implements java.lang.Runnable, java.lang.Cloneable

The OutputRecordsTask encapsulates generic processing required for processing OutputAdapter records. Derived classes override processRecords method to perform processing specific to type of output records.

Since:
1.0
Author:
Chandra Ilindra

Field Summary
protected  AbstractOutputAdapter parent
           
 
Constructor Summary
OutputRecordsTask(AbstractOutputAdapter aoa, int mr, ExceptionHandler eh)
          Constructor
 
Method Summary
 java.lang.Object clone()
          Simple Object based clone() method.
protected abstract  void processRecords(java.util.Collection records, Transaction transacttion)
          Abstract method overriden by the concreate classes to perform processing specific to each subclass.
 void run()
          This is core processing logic method run by this task.
 void setRecords(java.util.Collection recs)
          sets the records to be processed by this task.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

protected AbstractOutputAdapter parent
Constructor Detail

OutputRecordsTask

public OutputRecordsTask(AbstractOutputAdapter aoa,
                         int mr,
                         ExceptionHandler eh)
Constructor

Parameters:
aoa - - reference to OutputAdapter
mr - - maximum number of retries for deadlocks
eh - - the exception handler to use when reporting asynch errors.
Since:
1.0
Method Detail

setRecords

public void setRecords(java.util.Collection recs)
sets the records to be processed by this task.

Parameters:
recs - - the records to process.
Since:
1.0

run

public void run()
This is core processing logic method run by this task. It creates a transaction and processes the records. If a deadlock occurs then it rollsback and retries one more time. Only maxRetries number of times retry occurs, otherwise a ProcessingException is thrown.

Specified by:
run in interface java.lang.Runnable
Since:
1.0

processRecords

protected abstract void processRecords(java.util.Collection records,
                                       Transaction transacttion)
                                throws TransactionException,
                                       ProcessingException,
                                       AuditException
Abstract method overriden by the concreate classes to perform processing specific to each subclass.

Parameters:
records -
transacttion -
Throws:
TransactionException
ProcessingException
AuditException

clone

public java.lang.Object clone()
Simple Object based clone() method.

Returns:
OutputRecordsTask object
Since:
1.0


Copyright © 2002-2004 Robert Half International. All Rights Reserved.