public class XmlConfiguration
extends java.lang.Object
Constructor and Description |
---|
XmlConfiguration(java.io.InputStream configuration)
Constructor.
|
XmlConfiguration(java.lang.String configuration)
Constructor.
|
XmlConfiguration(java.net.URL configuration)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
configure()
Configure an object.
|
void |
configure(java.lang.Object obj)
Configure an object.
|
java.util.Map |
getIdMap() |
java.util.Map |
getProperties() |
static void |
main(java.lang.String[] args)
Run the XML configurations as a main application.
|
void |
setIdMap(java.util.Map map) |
void |
setProperties(java.util.Map map) |
public XmlConfiguration(java.net.URL configuration) throws org.xml.sax.SAXException, java.io.IOException
configuration
- org.xml.sax.SAXException
java.io.IOException
public XmlConfiguration(java.lang.String configuration) throws org.xml.sax.SAXException, java.io.IOException
configuration
- String of XML configuration commands excluding the normal XML preamble.
The String should start with a " org.xml.sax.SAXException
java.io.IOException
public XmlConfiguration(java.io.InputStream configuration) throws org.xml.sax.SAXException, java.io.IOException
configuration
- An input stream containing a complete e.g. configuration fileorg.xml.sax.SAXException
java.io.IOException
public java.util.Map getIdMap()
public void setIdMap(java.util.Map map)
public void setProperties(java.util.Map map)
public java.util.Map getProperties()
public void configure(java.lang.Object obj) throws java.lang.Exception
obj
- The object to be configured.java.lang.Exception
public java.lang.Object configure() throws java.lang.Exception
java.lang.Exception
public static void main(java.lang.String[] args)
Any property file on the command line is added to a combined Property instance that is passed to
each configuration file via setProperties(Map)
.
Each configuration file on the command line is used to create a new XmlConfiguration instance and the
configure()
method is used to create the configured object. If the resulting
object is an instance of LifeCycle
, then it is started.
Any IDs created in a configuration are passed to the next configuration file on the command line using
getIdMap()
and setIdMap(Map)
. This allows objects with IDs created in one config file to
be referenced in subsequent config files on the command line.
args
- array of property and xml configuration filenames or Resource
s.Copyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.