org.javasteps
Class ProcessManager

java.lang.Object
  extended by org.javasteps.ProcessManager

public class ProcessManager
extends Object

The ProcessManager class is used to hold all the registered processes. This class is a singleton

Version:
1.1
Author:
Ran Kornfeld

Method Summary
static ProcessManager getInstance()
          Get the singleton instance
 Process getProcess(String name)
          Get a registered process by name
 void registerExceptionHandler(StepAction handler)
          Registers a global exception handler.
 Process registerProcess(InputStream processFile)
          Register a new process by specifing the process definition file as an InputStream
 Process registerProcess(String processFileResName)
          Register a new process by specifing the process definition file as a String representing a resource name available to the class loader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ProcessManager getInstance()
Get the singleton instance


getProcess

public Process getProcess(String name)
                   throws ProcessNotFoundException
Get a registered process by name

Parameters:
name - The process name
Returns:
The Process instance
Throws:
ProcessNotFoundException - throws if a process is not found by the specified name

registerProcess

public Process registerProcess(InputStream processFile)
                        throws ProcessParsingException
Register a new process by specifing the process definition file as an InputStream

Parameters:
processFile - InputStream to the process definition XML file
Returns:
The newly created process instance
Throws:
ProcessParsingException - Thrown on parsing exceptions

registerProcess

public Process registerProcess(String processFileResName)
                        throws ProcessParsingException
Register a new process by specifing the process definition file as a String representing a resource name available to the class loader

Parameters:
processFileResName - A String representing the process definition file resource
Returns:
The newly created process instance
Throws:
ProcessParsingException - Thrown on parsing exceptions

registerExceptionHandler

public void registerExceptionHandler(StepAction handler)
Registers a global exception handler. The handler will be registered in every process that is registered with this ProcessManager.

Parameters:
handler - The exception handler