|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.modeler.BaseModelMBean org.objectweb.jonas.resource.ArchiveConfigMBean
A generic archive configuration MBean class which provides the ability to extract an XML configuration file from an archive (jar/war/ear/rar) as either a Document or as a String of XML. As well as storing an updated configuration file.
Field Summary |
Fields inherited from class org.apache.commons.modeler.BaseModelMBean |
attributeBroadcaster, attributes, generalBroadcaster, info, oname, registry, resource, resourceType, source |
Constructor Summary | |
ArchiveConfigMBean()
Default constructor, constructs a BaseModelMBean. |
Method Summary | |
void |
addXML(java.lang.String archiveName,
java.lang.String xmlFilePath,
java.lang.String docString)
|
void |
createArchiveWithXmlFile(java.lang.String archiveName,
java.lang.String xmlFilePath,
java.lang.String doc)
|
org.w3c.dom.Document |
extractDocument(java.lang.String archiveName,
java.lang.String xmlFilePath)
Extracts a Document representation of the XML file provided by xmlFilePath within the archive archiveName . |
java.lang.String |
extractXML(java.lang.String archiveName,
java.lang.String xmlFilePath)
Extracts a String representation of the XML file provided by xmlFilePath within the archive archiveName . |
protected org.xml.sax.EntityResolver |
getEntityResolver()
Return an EntityResolver for this MBean. |
protected java.util.List |
getSchemaList()
Get a list of possible schema locations to validate against. |
void |
saveXML(java.lang.String archiveName,
java.lang.String xmlFilePath,
org.w3c.dom.Document doc)
Saves the given org.w3c.dom.Document back into an archive
of the name given by archiveName. |
void |
verifyDocument(org.w3c.dom.Document doc)
Verifies that the Document is correct with respect to the schemas associated with the XML. |
Methods inherited from class org.apache.commons.modeler.BaseModelMBean |
addAttributeChangeNotificationListener, addNotificationListener, createDefaultModelMBeanInfo, createResource, getAttribute, getAttributes, getClassName, getManagedResource, getMBeanInfo, getModelerType, getNotificationInfo, getObjectName, getRegistry, initModelInfo, invoke, isModelMBeanInfoValid, load, postDeregister, postRegister, preDeregister, preRegister, removeAttributeChangeNotificationListener, removeAttributeChangeNotificationListener, removeNotificationListener, removeNotificationListener, removeNotificationListener, sendAttributeChangeNotification, sendAttributeChangeNotification, sendNotification, sendNotification, setAttribute, setAttributes, setManagedResource, setModeledType, setModelMBeanInfo, setRegistry, store, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ArchiveConfigMBean() throws javax.management.MBeanException
javax.management.MBeanException
- from the super class.Method Detail |
public void createArchiveWithXmlFile(java.lang.String archiveName, java.lang.String xmlFilePath, java.lang.String doc) throws java.io.IOException
java.io.IOException
public void addXML(java.lang.String archiveName, java.lang.String xmlFilePath, java.lang.String docString) throws java.io.IOException
java.io.IOException
public void saveXML(java.lang.String archiveName, java.lang.String xmlFilePath, org.w3c.dom.Document doc) throws java.io.IOException
org.w3c.dom.Document
back into an archive
of the name given by archiveName.
The Java Jar/Archive classes apparently do not provide support for
simply updating a file in place in an archive, so a temporary archive
must be created and have the contents of the existing archive copied over
(with the exception of the updated Document file) then remove the existing
archive and rename the temporary one.
archiveName
- The name (and path) of the archive to updated.xmlFilePath
- The path within the archive to the XML file being updated.doc
- The Document representation of the XML file being updated.
java.io.IOException
- If the updating fails.public void verifyDocument(org.w3c.dom.Document doc) throws org.xml.sax.SAXException, java.io.IOException
doc
- The Document to validate.
org.xml.sax.SAXException
- If the document fails validation.
java.io.IOException
- If there is an error opening a schema.protected org.xml.sax.EntityResolver getEntityResolver()
public org.w3c.dom.Document extractDocument(java.lang.String archiveName, java.lang.String xmlFilePath) throws java.lang.Exception
xmlFilePath
within the archive archiveName
.
archiveName
- The archive from which to extract the XML.xmlFilePath
- The path within the archive to the XML file.
java.lang.Exception
- if the document cannot be extracted.public java.lang.String extractXML(java.lang.String archiveName, java.lang.String xmlFilePath) throws java.lang.Exception
xmlFilePath
within the archive archiveName
.
archiveName
- The archive from which to extract the XML.xmlFilePath
- The path within the archive to the XML file.
java.lang.Exception
- if the XML cannot be extracted.protected java.util.List getSchemaList()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |