com.rhi.architecture.parc
Class AbstractPipeline

java.lang.Object
  extended bycom.rhi.architecture.parc.AbstractPipeline
All Implemented Interfaces:
Pipeline
Direct Known Subclasses:
ParallelMTPipeline, SerialMTPipeline

public abstract class AbstractPipeline
extends java.lang.Object
implements Pipeline

Abstract Pipeline class. Implements the basics. The process() method needs to be implemented by the concrete class.

Since:
1.0
Author:
Pete McKinstry

Constructor Summary
AbstractPipeline()
          Constructor.
 
Method Summary
 void addFilter(Filter f)
          Add a new filter to the set.
 void addFilter(Filter f, Channel c)
          Add a new filter to the set.
 Channel getErrorChannel()
          Return the error channel for the pipeline.
 ExceptionHandler getExceptionHandler()
          Returns the handler.
protected  java.util.List getFilters()
          Return the filters.
 Channel getInputChannel()
          Return the inbound side of this pipeline.
 Channel getOutputChannel()
          Return the outbound side of this pipeline.
 void init(Channel ch)
          Set the default channel
protected  Logger log()
           
 void setExceptionHandler(ExceptionHandler handler)
          Return the error channel for the pipeline.
protected  void stopFilters(java.lang.ThreadGroup root)
          Useful in clean shutdown when an error condition occured.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.rhi.architecture.parc.Pipeline
flush, process
 

Constructor Detail

AbstractPipeline

public AbstractPipeline()
Constructor. takes single parameter equal to the number of threads of each filter. Defaults Channel to general purpose implementation

Since:
1.0
Method Detail

init

public void init(Channel ch)
          throws InitializationException
Set the default channel

Specified by:
init in interface Pipeline
Parameters:
ch -
Throws:
InitializationException
Since:
1.1

setExceptionHandler

public void setExceptionHandler(ExceptionHandler handler)
Return the error channel for the pipeline. This can be used by every Filter for records that are errored, so that they don't clog up the main processing channels.

Specified by:
setExceptionHandler in interface Pipeline
Parameters:
handler - - the exception handler to be used when reporting exceptions asynchronously.
Since:
1.0

getExceptionHandler

public ExceptionHandler getExceptionHandler()
Returns the handler.

Returns:
ExceptionHandler

getInputChannel

public Channel getInputChannel()
Return the inbound side of this pipeline. This is used to connect the input adapter to the pipeline.

Specified by:
getInputChannel in interface Pipeline
Returns:
Channel - the input channel
Since:
1.0

getOutputChannel

public Channel getOutputChannel()
Return the outbound side of this pipeline. This is used to connect the output adapter to the pipeline.

Specified by:
getOutputChannel in interface Pipeline
Returns:
Channel - the outbound channel
Since:
1.0

getErrorChannel

public Channel getErrorChannel()
Return the error channel for the pipeline. This can be used by every Filter for records that are errored, so that they don't clog up the main processing channels.

Specified by:
getErrorChannel in interface Pipeline
Returns:
Channel - the error channel
Since:
1.0

getFilters

protected java.util.List getFilters()
Return the filters.

Returns:
List - Filters
Since:
1.0

addFilter

public void addFilter(Filter f)
Add a new filter to the set. New filters are appended to the end of the list & run in that order.
When a new filter is added to the set, a channel is created to connect the previously final filter to the new addition. The new filter is then connected to output adapter. (end of the line) When no channel is provided, a default general purpose channel is used.

Specified by:
addFilter in interface Pipeline
Parameters:
f - the Filter to be added to collection
Since:
1.0

addFilter

public void addFilter(Filter f,
                      Channel c)
Add a new filter to the set. New filters are appended to the end of the list & run in that order.
An optional Channel parameter can be provided as the preferred Channel implementation for the outbound side of this filter.

Specified by:
addFilter in interface Pipeline
Parameters:
f - The Filter to be added to collection
c - The Channel to be used on outbound side of this filter.
Since:
1.0

stopFilters

protected void stopFilters(java.lang.ThreadGroup root)
Useful in clean shutdown when an error condition occured. Called from a concrete Pipeline.

Parameters:
root - - ThreadGroup root

log

protected Logger log()


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