org.umber.catalan.process.workers
Interface IWorker

All Superinterfaces:
IMetadataHolder
All Known Implementing Classes:
BaseJob, BaseWorker

public interface IWorker
extends IMetadataHolder

Fundamental interface for processing node queues.

Author:
jsheets

Method Summary
 IWorkProperties getDefaultProperties()
          Retrieves the default properties for this IWorker.
 void process(IWorkProperties runtimeProps, IWorkspace workspace)
          Perform one stage of processing in the workspace.
 void setDefaultProperties(IWorkProperties defaultProps)
          Initializes IWorker with default properties.
 
Methods inherited from interface org.umber.catalan.process.workers.IMetadataHolder
getMetadata, validateProperties, validateType
 

Method Detail

setDefaultProperties

public void setDefaultProperties(IWorkProperties defaultProps)
                          throws WorkPropertyException
Initializes IWorker with default properties. The IWorker implementation can throw an exception if the default properties are invalid for that IWorker. The old set of properties is completely removed.

Parameters:
defaultProps - default initialization data
Throws:
WorkPropertyException - if any given config parameters are invalid

getDefaultProperties

public IWorkProperties getDefaultProperties()
Retrieves the default properties for this IWorker. It is up to the IWorker implementation how these properties are merged into the other available properties at process time.

Returns:
default properties

process

public void process(IWorkProperties runtimeProps,
                    IWorkspace workspace)
             throws ProcessException
Perform one stage of processing in the workspace. If the IWorker needs to operate on any Queues, they must be specified in either the IWorker's defaultProps, or in the runtimeConfig supplied here. The process() method can be called many times for a single IWorker instance throughout a processing run; state should not be cached between process() invocations.

Parameters:
runtimeProps - extra runtime parameters
workspace - processing environment
Throws:
ProcessException - if a fatal error occurs during processing, if any mandatory parameters are missing, if any parameters are invalid, or if workspace parameter is null