com.rhi.architecture.parc.adapter.xml
Class XMLOutputAdapter

java.lang.Object
  extended bycom.rhi.architecture.parc.adapter.AbstractOutputAdapter
      extended bycom.rhi.architecture.parc.adapter.xml.XMLOutputAdapter
All Implemented Interfaces:
Adapter, OutputAdapter, java.lang.Runnable

public class XMLOutputAdapter
extends AbstractOutputAdapter

XML Output Adapter. Uses Castor to perform mapping from java objects to XML.

Since:
1.0
Author:
Pete McKinstry

Field Summary
 
Fields inherited from interface com.rhi.architecture.parc.OutputAdapter
DEFAULT_THREAD_MODE, RUN_AS_THREAD, RUN_AS_THREAD_KEY
 
Constructor Summary
XMLOutputAdapter()
           
 
Method Summary
 void cleanup()
          cleanup any resources.
 java.lang.String getErrorFilename()
          Get filename for errored records.
 java.lang.String getValidFilename()
          Get filename for valid records.
protected  void handleErrorRecords(java.util.Collection c, Transaction t)
          Stream errored records to file in XML format.
 java.util.Collection handleValidRecords(java.util.Collection c, Transaction t)
          Handle persistence of valid records from the framework.
 void init(java.util.Properties props)
          Initialize the Castor data binding facilities so that the doWrite() method is ready to go.
 void transform(java.lang.String filename)
          Placeholder to support XSLT transformations on the XML output as part of the interface.
 
Methods inherited from class com.rhi.architecture.parc.adapter.AbstractOutputAdapter
close, completeBatch, createTransaction, flush, getAuditAgent, log, markComplete, run, setAuditAgent, setErrorChannel, setExceptionHandler, setValidChannel, write, writeErrorRecords, writeValidRecords
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLOutputAdapter

public XMLOutputAdapter()
Method Detail

init

public void init(java.util.Properties props)
          throws InitializationException
Initialize the Castor data binding facilities so that the doWrite() method is ready to go.

Specified by:
init in interface OutputAdapter
Overrides:
init in class AbstractOutputAdapter
Parameters:
props -
Throws:
InitializationException

getValidFilename

public java.lang.String getValidFilename()
Get filename for valid records.

Returns:
Since:
1.0

getErrorFilename

public java.lang.String getErrorFilename()
Get filename for errored records.

Returns:
Since:
1.0

cleanup

public void cleanup()
cleanup any resources.

Specified by:
cleanup in interface OutputAdapter
Overrides:
cleanup in class AbstractOutputAdapter

handleValidRecords

public java.util.Collection handleValidRecords(java.util.Collection c,
                                               Transaction t)
                                        throws ProcessingException
Handle persistence of valid records from the framework.

Specified by:
handleValidRecords in class AbstractOutputAdapter
Parameters:
c - - valid records.
t - - the transaction to use persisting records.
Returns:
Collection - records errored during persistence.
Throws:
ProcessingException
Since:
1.0

transform

public void transform(java.lang.String filename)
Placeholder to support XSLT transformations on the XML output as part of the interface. This method is designed to be overridden.

Parameters:
filename -
Since:
1.0

handleErrorRecords

protected void handleErrorRecords(java.util.Collection c,
                                  Transaction t)
                           throws ProcessingException
Stream errored records to file in XML format.

Specified by:
handleErrorRecords in class AbstractOutputAdapter
Parameters:
c -
t -
Throws:
ProcessingException


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