com.rhi.architecture.parc
Interface OutputAdapter

All Superinterfaces:
Adapter, java.lang.Runnable
All Known Implementing Classes:
AbstractOutputAdapter

public interface OutputAdapter
extends Adapter, java.lang.Runnable

The OutputAdapter is responsible for taking a completed work set and storing it.

Since:
1.0
Author:
Pete McKinstry

Field Summary
static java.lang.String DEFAULT_THREAD_MODE
          DEFAULT_THREAD_MODE is multi-threaded
static java.lang.String RUN_AS_THREAD
          RUN_AS_THREAD = 'Y' means multi-threaded.
static java.lang.String RUN_AS_THREAD_KEY
          key in configuration that can be used to set the thread mode for the output adapter.
 
Method Summary
 void cleanup()
          Perform any cleanup.
 void close()
          Close is called outside of the strategy to allow the output adapter to commit any work that should only be done once per interface run.
 void init(java.util.Properties props)
          Initialization.
 void markComplete()
          Mark output adapter complete
 void run()
          Processing method for the output adapter.
 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
 
Methods inherited from interface com.rhi.architecture.parc.Adapter
getAuditAgent, setAuditAgent
 

Field Detail

RUN_AS_THREAD_KEY

public static final java.lang.String RUN_AS_THREAD_KEY
key in configuration that can be used to set the thread mode for the output adapter.

See Also:
Constant Field Values

RUN_AS_THREAD

public static final java.lang.String RUN_AS_THREAD
RUN_AS_THREAD = 'Y' means multi-threaded.

See Also:
Constant Field Values

DEFAULT_THREAD_MODE

public static final java.lang.String DEFAULT_THREAD_MODE
DEFAULT_THREAD_MODE is multi-threaded

See Also:
Constant Field Values
Method Detail

init

public void init(java.util.Properties props)
          throws InitializationException
Initialization. This method can acquire resources that will be needed for record processing, and/or configure settings.

Specified by:
init in interface Adapter
Parameters:
props -
Throws:
InitializationException - - an error occured while configuring the output adapter. This will cause the application to shutdown.
Since:
1.0

run

public void run()
Processing method for the output adapter. Opens the possibility of processing completed records asynchronously while the pipeline is running. It can also be run directly by the exec strategy from within the main thread. Both modes are supported and reasonable.

Specified by:
run in interface java.lang.Runnable
See Also:
Runnable.run()

markComplete

public void markComplete()
Mark output adapter complete


close

public void close()
           throws ProcessingException
Close is called outside of the strategy to allow the output adapter to commit any work that should only be done once per interface run. NOT once per batch cycle like flush().

Throws:
ProcessingException - Signals a fatal error. The application will shutdown if this exception is thrown.
Since:
1.1

cleanup

public void cleanup()
Perform any cleanup. Called by the PARCApplication during application shutdown. This should do any final cleanup and closing of resources. Note: It is not called during repeated batch cycles, so it's only useful for true shutdown logic. If you need something to happen during each pipeline execution, use flush(). Since the application is shutting down when cleanup is called, there are no checked exceptions thrown from this method. Cleanup failures should be able to be ignored.

Specified by:
cleanup in interface Adapter
Since:
1.0

setValidChannel

public void setValidChannel(Channel ch)
Set valid record channel

Parameters:
ch -

setErrorChannel

public void setErrorChannel(Channel ch)
Set error record channel

Parameters:
ch -

setExceptionHandler

public void setExceptionHandler(ExceptionHandler h)
Set the handler used for reporting fatal errors during Filter processing. Since each Filter is run w/in a thread, the call stack is not an appropriate mechanism for reporting critical processing errors. Therefore, a Handler object is provided for the Filter to use for logging unrecoverable processing errors. Note: This handler must assume that any error is fatal. Non-fatal errors should be handled by adding errors to the record(s) being processed.

Parameters:
h - - the exception handler that should be used.
Since:
1.0


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