|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.writersforge.catalan.process.WorkProcessor
Top level driver for running worker processes.
| Constructor Summary | |
WorkProcessor(IWorkspace workspace)
Creates a new instance of WorkProcessor from instantiated workspace and registry objects. |
|
WorkProcessor(java.lang.String[] args)
Creates a new instance of WorkProcessor, using paths to XML versions of the workspace and registry. |
|
| Method Summary | |
IWorkspace |
getWorkspace()
Retrieves this WorkProcessor's workspace. |
protected void |
handleProcessException(ProcessException e)
Handles the processing exception. |
static void |
main(java.lang.String[] args)
Runs the given workers. |
void |
processBatch(java.lang.String[] workerNames,
IWorkProperties runtimeProps)
Executes the workers in workerNames, in the order they
occur in the array, passing the given runtime properties into each
invocation. |
void |
processFromArgs()
Executes the workers named on the command line, using the command line arguments as the runtime properties. |
void |
processWorker(java.lang.String name,
IWorkProperties runtimeProps)
Executes the single worker or job of the given name, using the given runtime properties. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public WorkProcessor(java.lang.String[] args)
throws WorkspaceException,
RegistryException
args - command-line arguments
WorkspaceException - if specified workspace cannot be loaded
RegistryException - if specified registry cannot be loaded
public WorkProcessor(IWorkspace workspace)
throws WorkspaceException
workspace - workspace for all operations in this processor
WorkspaceException - if workspace is null| Method Detail |
public IWorkspace getWorkspace()
public void processFromArgs()
throws ProcessException
--workspace workspace.xml --registry registry.xml --count 14 worker1 worker2The WorkProcessor would invoke the
IWorker.process() on
"worker1" and "worker2" from the registry associated with this processor.
It would pass in runtime properties for "workspace", "registry", and
"count", loaded from the command-line arguments.
ProcessException - if errors occur during IWorker processing
public void processBatch(java.lang.String[] workerNames,
IWorkProperties runtimeProps)
throws ProcessException
workerNames, in the order they
occur in the array, passing the given runtime properties into each
invocation.
workerNames - an array of IWorker namesruntimeProps - runtime properties to pass into each IWorker
ProcessException - if errors occur during IWorker processing
public void processWorker(java.lang.String name,
IWorkProperties runtimeProps)
throws ProcessException
name - name of IWorker in registry to runruntimeProps - runtime properties to pass into IWorker.process()
ProcessException - if errors occur during IWorker processing
protected void handleProcessException(ProcessException e)
throws ProcessException
A sub-class of WorkProcessor might, for example, choose to set certain ProcessExceptions as ERRORs or WARNINGs instead, or rethrow them to immediately halt all processing.
e - processing exception to handle
ProcessException - if the processor should bail out prematurelypublic static void main(java.lang.String[] args)
args -
ProcessException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||