A configuration context represents a heirarchical view of the configuration attributes. It reads the configuration attributes from
server.xml The configuration context has a one-to-one realationship with a configuration file. There is no public constructor. Use ConfigFactory to construct ConfigContext. This object can be made readOnly and autoCommit during creation but these parameters cannot be changed once the object is created. Note that this object might be shared by number of threads. Here are some examples of code to illustrate lookup: 1. If you want to specifically locate a Node in the configuration: example: jms resource in server.xml
ConfigBean conBean = ctx.exactLookup("/server/resources/jms-resource[@name='jms1']");
Follow the syntax below for creating xpath expression for use in lookup/exactLookup. This is the only syntax supported.
expression := /tagName | /tagName/tagExpression tagExpression := tagName| tagName[@name='value'] | tagName/tagExpression | tagName[@name='value']/tagExpression
Config API documentation: Config API is a powerful set of APIs that handle comples operations like:
1. Basic Configuration (set and get elements and attributes APIs) 2. Event Notification 3. Cloning 4. XPath support 5. Change Mananagement (add, update, delete, set) 6. readonly 7. Auto Commit 8. Advanced Configuration (1 API to access attributes--ctx.getAttribute()) 9. Intelligent refresh 10. Get dtd default values 11. DOM like API support (appendChild, removeChild) 12. Find APIs 13. Support Serialization and DeSerialization 14. Other Misc APIs (getChildBeansByName, getXPath, etc) 15. Merge APIs