com.rhi.architecture.parc.filter
Class PollingFilter

java.lang.Object
  extended bycom.rhi.architecture.parc.filter.AbstractFilter
      extended bycom.rhi.architecture.parc.filter.PollingFilter
All Implemented Interfaces:
Filter, java.lang.Runnable

public abstract class PollingFilter
extends AbstractFilter

PollingFilter.java

Version:
1.0
Author:
Pete McKinstry

Field Summary
static java.lang.String CYCLE_SLEEP_TIME_FLAG
          time to sleep between polling.
static java.lang.String DEFAULT_SLEEP_TIME
          default sleep time between polls
 
Constructor Summary
PollingFilter()
          Constructor for PollingFilter.
PollingFilter(int max)
          Constructor for PollingFilter.
 
Method Summary
 void init(java.util.Properties p)
          Initialize common Filter settings.
 void process()
          Push a collection of records through the filter.
 
Methods inherited from class com.rhi.architecture.parc.filter.AbstractFilter
doWork, getErrorChannel, getExceptionHandler, getInbound, getMaxRecords, getName, getOutbound, isShutdown, log, markForDeath, numThreads, reset, run, setErrorChannel, setExceptionHandler, setInbound, setMaxRecords, setNumThreads, setOutbound, stats
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CYCLE_SLEEP_TIME_FLAG

public static final java.lang.String CYCLE_SLEEP_TIME_FLAG
time to sleep between polling.

See Also:
Constant Field Values

DEFAULT_SLEEP_TIME

public static final java.lang.String DEFAULT_SLEEP_TIME
default sleep time between polls

See Also:
Constant Field Values
Constructor Detail

PollingFilter

public PollingFilter()
Constructor for PollingFilter.


PollingFilter

public PollingFilter(int max)
Constructor for PollingFilter.

Parameters:
max -
Method Detail

init

public void init(java.util.Properties p)
          throws InitializationException
Description copied from class: AbstractFilter
Initialize common Filter settings. Note: sub-classes may override this method, but they must call super.init() in addition to doing their own local initialization. If any of these values are already set, they will be over- written. If you don't want that to happen, do not provide a property setting for these attributes.

Sets the following common Filter attributes. 1) .max_records: the max number of records to be pulled from the channel during each work cycle. 2) .num_threads: the number of threads to run for this filter. If no setting is found, the default value will be used. - For threads, the default is 1. - For work sets, the default size is 20.

Specified by:
init in interface Filter
Overrides:
init in class AbstractFilter
Parameters:
p -
Throws:
InitializationException
See Also:
Filter.init(Properties)

process

public void process()
             throws ProcessingException
Push a collection of records through the filter.
Details: The NotificationFilter processes records w/in a dependent loop. The exit criteria for the loop is the markForDeath() flag which should be set by the pipeline, _and_ an empty processing cycle. This allows the Strategy to flush the Pipeline w/o knowing much about the inner workings of the Filter. While this criteria is false, the Filter does this: (pseudo-code) InboundChannel.pull(); doWork() OutboundChannel.push();

This method must be threadsafe as it is the fundamental multi-processing hook in the framework.

Throws:
ProcessingException
Since:
1.0


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