|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.rhi.architecture.parc.adapter.AbstractOutputAdapter
The OutputAdapter is responsible for taking a completed work set and storing it. File or DB persistence mechanisms will be the only initially supported output adapter types.
| Field Summary |
| Fields inherited from interface com.rhi.architecture.parc.OutputAdapter |
DEFAULT_THREAD_MODE, RUN_AS_THREAD, RUN_AS_THREAD_KEY |
| Constructor Summary | |
AbstractOutputAdapter()
Default constructor. |
|
| Method Summary | |
void |
cleanup()
cleanup() is called by the BatchApplication during shutdown. |
void |
close()
No op by default. |
protected void |
completeBatch(Transaction transaction)
Do any non-record level processing required to finish this batch cycle. |
Transaction |
createTransaction()
Create a transaction of the appropriate type. |
void |
flush()
Do any required processing prior to completing the batch cycle. |
AuditAgent |
getAuditAgent()
get audit agent |
protected abstract void |
handleErrorRecords(java.util.Collection c,
Transaction t)
Defer handling of valid records to sub-classes.. |
protected abstract java.util.Collection |
handleValidRecords(java.util.Collection c,
Transaction t)
Defer handling of valid records to sub-classes.. |
void |
init(java.util.Properties props)
Load error logfile & create writer. |
Logger |
log()
Returns the Logger |
void |
markComplete()
Mark output adapter complete |
void |
run()
Processing method for the output adapter. |
void |
setAuditAgent(AuditAgent agent)
Set method to tell the OutputAdapter what audit agent to use. |
void |
setErrorChannel(Channel ch)
Set error record channel |
void |
setExceptionHandler(ExceptionHandler h)
Set the handler used for reporting fatal errors during Filter processing. |
void |
setValidChannel(Channel ch)
Set valid record channel |
void |
write(Channel ch,
Channel err)
Persist valid and errored records to the appropriate data store. |
void |
writeErrorRecords(Channel err)
To Improve Performance, a thread pool is created and used. |
void |
writeValidRecords(Channel ch)
To Improve Performance, a thread pool is created and used. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AbstractOutputAdapter()
| Method Detail |
public final void setAuditAgent(AuditAgent agent)
setAuditAgent in interface Adapteragent - public final AuditAgent getAuditAgent()
getAuditAgent in interface Adapter
public void init(java.util.Properties props)
throws InitializationException
init in interface OutputAdapterprops -
InitializationExceptionpublic void cleanup()
cleanup in interface OutputAdapter
public void flush()
throws ProcessingException
ProcessingException - Signals a fatal error. The
application will shutdown if this exception is thrown.public void run()
OutputAdapter
run in interface OutputAdapterRunnable.run()
public void write(Channel ch,
Channel err)
throws ProcessingException
ch - Channel holding bin for valid records waiting to be
persisted.err - Channel holding bin for errored records
waiting to be persisted.
ProcessingException - error occured
during write. Signals a fatal error. The application
will shutdown if this exception is thrown.
public void writeValidRecords(Channel ch)
throws ProcessingException
ch - Channel valid records.
ProcessingException
public void writeErrorRecords(Channel err)
throws ProcessingException
err - Channel error records.
ProcessingException
protected abstract java.util.Collection handleValidRecords(java.util.Collection c,
Transaction t)
throws ProcessingException
c - Collection valid records.t - Transaction transaction under which these records should
be committed.
ProcessingException
protected abstract void handleErrorRecords(java.util.Collection c,
Transaction t)
throws ProcessingException
c - Collection valid records.t - Transaction transaction under which these records should
be committed.
ProcessingException
protected void completeBatch(Transaction transaction)
throws ProcessingException
transaction -
ProcessingException
public void close()
throws ProcessingException
close in interface OutputAdapterProcessingExceptionOutputAdapter.close()public void setErrorChannel(Channel ch)
OutputAdapter
setErrorChannel in interface OutputAdapterch - OutputAdapter.setErrorChannel(Channel)public void setValidChannel(Channel ch)
OutputAdapter
setValidChannel in interface OutputAdapterch - OutputAdapter.setValidChannel(Channel)public void setExceptionHandler(ExceptionHandler h)
OutputAdapter
setExceptionHandler in interface OutputAdapterh - OutputAdapter.setExceptionHandler(ExceptionHandler)public void markComplete()
OutputAdapter
markComplete in interface OutputAdapterOutputAdapter.markComplete()
public Transaction createTransaction()
throws ProcessingException
ProcessingExceptionpublic Logger log()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||