-----------------------------
Configuration using Digester
-----------------------------
Configuration using Digester
A simple and straightforward way of creating a pipeline is to use an XML
configuration file. Commons Pipeline provides a set of Digester rules that can
be used to set up a pipeline based upon such a file.
One important thing to note is that, due to the way that Digester handles
the mapping of XML attributes to object properties, it is not possible to
define a comprehensive DTD that fully describes the XML syntax for all possible
legal configuration files; however, this does not prove to be a significant
limitation and the flexibility that it provides outweighs the disadvantages
of the limited possibility for validation.
Basic XML Structure
+---+
...
+---+
Attributes for each element are discussed in their respective subsections.
* \\
The \ element is the root element of the document. It is used to
define primary pipeline that will be created. The root \ tag does not
support any attributes by default; instances of the tag nested within \
tags support the following attributes:
[configUri] The URI of the configuration file to digest to create the branch
pipeline. Currently, only absolute URIs are supported (either
http:// or file://). Only used when the \ element is
nested within a \ tag; required in this case.
[key] The key used to refer to the pipeline branch. Only used when the
\ element is nested within a \ tag; required
in this case.
* \\
This tag is used to add a branch to a pipeline. The contents of this tag
should be one or more \ declarations. Branch pipelines added in this
fashion must be configured with an attribute named <<>> that specifies the
name used to refer to the branch.
Branch pipelines may be configured either inline in the main configuration
file or in a separate file referred to by the <<>> pipeline
attribute.
* \
The \ element is used to register a StageEventListener with the
pipeline. This element supports any number of attributes, with the
<<>> attribute being reserved to define the class of the registered
listener. All other attributes are mapped to properties that are set on the
created listener object, using standard Java bean naming conventions.
[className] The class of the listener object to be created and registered
with the pipeline. Required.
* \
The \ element is used to create and configure a
StageDriverFactory that will be used to create StageDriver instances for stages
in the parent pipeline. Each StageDriverFactory is identified by a unique
string identifier that is used by the \ tag to identify the factory used
to create the driver for the stage. This tag supports two attributes, <<>>
and <<>>. All other attributes are mapped to properties that are set
on the created factory, using standard Java bean naming conventions.
[className] The class of the factory, which must supply a no-argument
constructor.
[id] The identifier used by the <<>> attribute of the
\ tag to refer to this factory.
* \\
The \ element can be used to add global environment variable
values to the pipeline by means of the \ and \