org.umber.catalan.process.workers
Class XmlWorkerRegistry

java.lang.Object
  extended byorg.umber.catalan.process.workers.WorkerRegistry
      extended byorg.umber.catalan.process.workers.XmlWorkerRegistry
Direct Known Subclasses:
DefaultWorkerRegistry

public class XmlWorkerRegistry
extends WorkerRegistry

WorkerRegistry that loads itself from an XML specification.

Author:
jsheets

Constructor Summary
XmlWorkerRegistry()
           
 
Method Summary
 void addWorkersFromDatum(Datum xml)
          Loads workers from any <workers> element inside the XML document.
 void addWorkersFromPath(java.lang.String registryXmlPath)
          Loads workers from any <workers> element inside the XML document at the given path.
 
Methods inherited from class org.umber.catalan.process.workers.WorkerRegistry
addClassWorker, addCustomWorker, addExternalWorker, getWorker, getWorkerNames
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlWorkerRegistry

public XmlWorkerRegistry()
Method Detail

addWorkersFromPath

public final void addWorkersFromPath(java.lang.String registryXmlPath)
                              throws RegistryException
Loads workers from any <workers> element inside the XML document at the given path. Instantiates IWorker objects from <worker> elements and BaseJob objects from <job> elements. The path is evaluated from the root classpath, and may point at files in the filesystem, or at files inside JARs.

Parameters:
registryXmlPath - path to XML document
Throws:
RegistryException - if unable to find or load XML document, or unable to load workers into registry

addWorkersFromDatum

public final void addWorkersFromDatum(Datum xml)
                               throws RegistryException
Loads workers from any <workers> element inside the XML document. Instantiates IWorker objects from <worker> elements and BaseJob objects from <job> elements.

Parameters:
xml - XML document
Throws:
RegistryException - if unable to load workers into registry