| org.objectweb.jonas.resource.ArchiveConfigMBean
All known Subclasses: org.objectweb.jonas.resource.RarConfigMBean,
ArchiveConfigMBean | public class ArchiveConfigMBean extends BaseModelMBean (Code) | | 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.
author: Patrick Smith author: Greg Lapouchnian |
Constructor Summary | |
public | ArchiveConfigMBean() Default constructor, constructs a BaseModelMBean. |
Method Summary | |
public void | addXML(String archiveName, String xmlFilePath, String docString) | public void | createArchiveWithXmlFile(String archiveName, String xmlFilePath, String doc) | public Document | extractDocument(String archiveName, String xmlFilePath) Extracts a Document representation of the XML file provided by
xmlFilePath within the archive archiveName .
Parameters: archiveName - The archive from which to extract the XML. Parameters: xmlFilePath - The path within the archive to the XML file. | public String | extractXML(String archiveName, String xmlFilePath) Extracts a String representation of the XML file provided by
xmlFilePath within the archive archiveName .
Parameters: archiveName - The archive from which to extract the XML. Parameters: xmlFilePath - The path within the archive to the XML file. | protected EntityResolver | getEntityResolver() Return an EntityResolver for this MBean. | protected List | getSchemaList() Get a list of possible schema locations to validate against. | public void | saveXML(String archiveName, String xmlFilePath, Document doc) Saves the given org.w3c.dom.Document back into an archive
of the name given by archiveName. | public void | verifyDocument(Document doc) Verifies that the Document is correct with respect to the schemas
associated with the XML. |
ArchiveConfigMBean | public ArchiveConfigMBean() throws MBeanException(Code) | | Default constructor, constructs a BaseModelMBean.
throws: MBeanException - from the super class. |
extractDocument | public Document extractDocument(String archiveName, String xmlFilePath) throws Exception(Code) | | Extracts a Document representation of the XML file provided by
xmlFilePath within the archive archiveName .
Parameters: archiveName - The archive from which to extract the XML. Parameters: xmlFilePath - The path within the archive to the XML file. A document representation of the XML file. throws: Exception - if the document cannot be extracted. |
extractXML | public String extractXML(String archiveName, String xmlFilePath) throws Exception(Code) | | Extracts a String representation of the XML file provided by
xmlFilePath within the archive archiveName .
Parameters: archiveName - The archive from which to extract the XML. Parameters: xmlFilePath - The path within the archive to the XML file. A String representation of the XML file. throws: Exception - if the XML cannot be extracted. |
getEntityResolver | protected EntityResolver getEntityResolver()(Code) | | Return an EntityResolver for this MBean.
an EntityResolver for this MBean. |
getSchemaList | protected List getSchemaList()(Code) | | Get a list of possible schema locations to validate against.
a list of schemas that are available for this type of deploymentdescriptor. |
saveXML | public void saveXML(String archiveName, String xmlFilePath, Document doc) throws IOException(Code) | | Saves the given 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.
Parameters: archiveName - The name (and path) of the archive to updated. Parameters: xmlFilePath - The path within the archive to the XML file being updated. Parameters: doc - The Document representation of the XML file being updated. throws: IOException - If the updating fails. |
verifyDocument | public void verifyDocument(Document doc) throws SAXException, IOException(Code) | | Verifies that the Document is correct with respect to the schemas
associated with the XML. If no exception is thrown then the XML is
either valid or no schemas were available for this XML. In which case
the Document can be considered verified.
Parameters: doc - The Document to validate. throws: SAXException - If the document fails validation. throws: IOException - If there is an error opening a schema. |
|
|