com.rhi.architecture.parc
Class ProcessSet

java.lang.Object
  extended bycom.rhi.architecture.parc.ProcessSet
All Implemented Interfaces:
Process

public final class ProcessSet
extends java.lang.Object
implements Process

The ProcessSet is a group of processes that are run serially. It is an implementation of the composite element of GOF Composite pattern.

Since:
1.0
Author:
Pete McKinstry

Field Summary
 
Fields inherited from interface com.rhi.architecture.parc.Process
NAME, SEPARATOR, TYPE
 
Constructor Summary
ProcessSet()
          Constructor
 
Method Summary
 void add(Process p)
          Add a new process to the set.
 void cleanup()
          Perform any cleanup required.
 java.lang.String getName()
          getName returns the configured name for this process.
 void init(java.util.Properties props)
          The ProcessSet is initialized by loading all Process definitions immediately under this ProcessSet definition.
 void run()
          Run each Process w/in the set serially in the order they were added.
 void setName(java.lang.String name)
          setName is called by the framework to provide the correct process name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessSet

public ProcessSet()
Constructor

Method Detail

init

public void init(java.util.Properties props)
          throws InitializationException
The ProcessSet is initialized by loading all Process definitions immediately under this ProcessSet definition. Processes are configured by providing 2 bootstrap configuration values. The first is the name of the class which implements the Process interface and provides the functionality which this Process needs to execute. The 2nd value is the name by which the Process should be known. This 2nd value is important to differentiate configuration data between 2 processes w/in the same PBApplication which both use the same Process class. For example, here is what the HR interface would look like: RootProcess.type = "com.rhi.architecture.parc.ProcessSet" RootProcess.name = "HRProcessSet" HRProcessSet.Process0.type = "com.rhi.architecture.parc.PipelineProcess" HRProcessSet.Process0.name = "rhmjp_hrogst" HRProcessSet.Process1.type = "com.rhi.architecture.parc.PipelineProcess" HRProcessSet.Process1.name = "rhmjp_hrofile" Both the type & the name must be provided for the configuration to be considered valid. Processes are loaded based on incremental values, meaning the number (see above) is incremented until no Process settings are found. If the number of Processes loaded is = 0, it is considered an error, and an InitializationException is thrown.

Specified by:
init in interface Process
Parameters:
props -
Throws:
InitializationException
Since:
1.0

run

public void run()
         throws ProcessingException
Run each Process w/in the set serially in the order they were added. .

Specified by:
run in interface Process
Throws:
ProcessingException
Since:
1.0

add

public void add(Process p)
Add a new process to the set. New processes are appended to the end of the list & run in that order.

Parameters:
p -
Since:
1.0

cleanup

public void cleanup()
Perform any cleanup required. This allows the Process to keep resources open after the run() method in case a multi-call strategy is used to execute run() repeatedly.

Specified by:
cleanup in interface Process
Since:
1.0

getName

public java.lang.String getName()
getName returns the configured name for this process. This method must return a unique identifier for each process running w/in the same BatchApplication. It is used to identify properties that are specific to a given Process.

Specified by:
getName in interface Process
Returns:
String
Since:
1.0

setName

public void setName(java.lang.String name)
setName is called by the framework to provide the correct process name.

Specified by:
setName in interface Process
Parameters:
name -
Since:
1.0


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