org.mortbay.xml
public class XmlConfiguration extends Object
Constructor and Description |
---|
XmlConfiguration(InputStream configuration)
Constructor.
|
XmlConfiguration(String configuration)
Constructor.
|
XmlConfiguration(URL configuration)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Object |
configure()
Configure an object.
|
void |
configure(Object obj)
Configure an object.
|
Map |
getIdMap() |
Map |
getProperties() |
static void |
main(String[] args)
Run the XML configurations as a main application.
|
void |
setIdMap(Map map) |
void |
setProperties(Map map) |
public XmlConfiguration(URL configuration) throws SAXException, IOException
configuration
- SAXException
IOException
public XmlConfiguration(String configuration) throws SAXException, IOException
configuration
- String of XML configuration commands excluding the normal XML preamble.
The String should start with a " SAXException
IOException
public XmlConfiguration(InputStream configuration) throws SAXException, IOException
configuration
- An input stream containing a complete e.g. configuration fileSAXException
IOException
public Map getIdMap()
public void setIdMap(Map map)
public void setProperties(Map map)
public Map getProperties()
public void configure(Object obj) throws Exception
obj
- The object to be configured.Exception
public Object configure() throws Exception
Exception
public static void main(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.