org.jboss.mx.metadata
Class XMLMetaData

java.lang.Object
  extended byorg.jboss.mx.metadata.AbstractBuilder (src) 
      extended byorg.jboss.mx.metadata.XMLMetaData
All Implemented Interfaces:
MetaDataBuilder (src) , ModelMBeanConstants (src) , ServiceConstants (src) , XMBeanConstants (src)

public class XMLMetaData
extends AbstractBuilder (src)
implements ServiceConstants (src) , XMBeanConstants (src)

Aggregate builder for XML schemas. This builder implementation is used as an aggregate for all XML based builder implementations. The correct XML parser is picked based on the schema declaration of the XML file.


Field Summary
 
Fields inherited from class org.jboss.mx.metadata.AbstractBuilder (src)
properties
 
Fields inherited from interface org.jboss.mx.service.ServiceConstants (src)
JBOSSMX_DOMAIN, JBOSSMX_XMBEAN_DTD_1_0, JBOSSMX_XMBEAN_DTD_1_1, JBOSSMX_XMBEAN_DTD_1_2, MBEAN_LOADER_DTD_1_0, PERSISTENCE_TIMER, PUBLIC_JBOSSMX_XMBEAN_DTD_1_0, PUBLIC_JBOSSMX_XMBEAN_DTD_1_1, PUBLIC_JBOSSMX_XMBEAN_DTD_1_2
 
Fields inherited from interface org.jboss.mx.modelmbean.XMBeanConstants (src)
DESCRIPTOR, GET_METHOD_ATTRIBUTE, METADATA_DESCRIPTOR_PREFIX, RESOURCE_DESCRIPTOR_PREFIX, RESOURCE_REFERENCE, RESOURCE_TYPE, SAX_PARSER, SET_METHOD_ATTRIBUTE, STANDARD_INTERFACE, STANDARD_MBEAN, XMBEAN_DESCRIPTOR_PREFIX, XML_VALIDATION
 
Fields inherited from interface org.jboss.mx.modelmbean.ModelMBeanConstants (src)
ACTION, ACTION_INFO, ALL_DESCRIPTORS, ATTRIBUTE_DESCRIPTOR, ATTRIBUTE_VALUE, CACHE_ALWAYS, CACHE_ALWAYS_LIMIT, CACHE_NEVER, CACHE_NEVER_LIMIT, CACHED_VALUE, CLASS, CONSTRUCTOR_DESCRIPTOR, CURRENCY_TIME_LIMIT, DEFAULT, DELEGATING_PM_OPERATION_DEFAULT_VALUE, DELEGATING_PM_OPERATION_DESCRIPTOR, DELEGATING_PM_SERVICE_DEFAULT_VALUE, DELEGATING_PM_SERVICE_DESCRIPTOR, DESCRIPTOR_TYPE, DISPLAY_NAME, EXPORT, GENERIC_MODELMBEAN_NOTIFICATION, GET_METHOD, HIGH_VISIBILITY, INFO, INTERCEPTORS, IS_IS, IS_READABLE, IS_WRITABLE, LAST_RETURNED_TIME_STAMP, LAST_UPDATED_TIME_STAMP, LAST_UPDATED_TIME_STAMP2, LOG, LOG_FILE, LOW_VISIBILITY, MBEAN_DESCRIPTOR, MBEAN_INFO_INJECTION_TYPE, MBEAN_SERVER_INJECTION_TYPE, MESSAGE_ID, MINIMAL_VISIBILITY, NAME, NORMAL_VISIBILITY, NOTIFICATION_DESCRIPTOR, OBJECT_NAME, OBJECT_NAME_INJECTION_TYPE, OBJECT_REF, OPERATION_DESCRIPTOR, PERSIST_INFO, PERSIST_LOCATION, PERSIST_NAME, PERSIST_PERIOD, PERSIST_POLICIES, PERSIST_POLICY, PERSISTENCE_MANAGER, PP_ALWAYS, PP_NEVER, PP_NO_MORE_OFTEN_THAN, PP_ON_TIMER, PP_ON_UPDATE, PRESENTATION_STRING, PROTOCOL_MAP, RESOURCE_CLASS, ROLE, ROLE_CONSTRUCTOR, ROLE_GETTER, ROLE_OPERATION, ROLE_SETTER, SET_METHOD, SEVERITY, SEVERITY_CRITICAL, SEVERITY_MAJOR, SEVERITY_MINOR, SEVERITY_NON_RECOVERABLE, SEVERITY_NORMAL, SEVERITY_UNKNOWN, SEVERITY_WARNING, TARGET_OBJECT, TARGET_TYPE, VISIBILITY
 
Constructor Summary
XMLMetaData(java.lang.String mmbClassName, java.lang.String resourceClassName, Element element, java.lang.String version)
          Creates a new XMLMetaData instance using an explicit DOM element as the configuration source, and requiring an explicit version indicator.
XMLMetaData(java.lang.String mmbClassName, java.lang.String resourceClassName, java.lang.String url)
          Constructs an aggregate XML builder implementation.
XMLMetaData(java.lang.String mmbClassName, java.lang.String resourceClassName, java.lang.String url, java.util.Map properties)
          Constructs an aggregate XML builder implementation.
XMLMetaData(java.lang.String mmbClassName, java.lang.String resourceClassName, java.net.URL url)
          Constructs an aggregate XML builder implementation.
XMLMetaData(java.lang.String mmbClassName, java.lang.String resourceClassName, java.net.URL url, java.util.Map properties)
          Constructs an aggregate XML builder implementation.
 
Method Summary
 MBeanInfo (src) build()
          Constructs the Model MBean metadata.
 
Methods inherited from class org.jboss.mx.metadata.AbstractBuilder (src)
getBooleanProperty, getProperties, getProperty, getStringProperty, setProperties, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLMetaData

public XMLMetaData(java.lang.String mmbClassName,
                   java.lang.String resourceClassName,
                   java.net.URL url)
Constructs an aggregate XML builder implementation.

Parameters:
mmbClassName - the class name of the Model MBean implementation
resourceClassName - the class name of the resource object the Model MBean represents
url - the URL for the XML definition of the management interface

XMLMetaData

public XMLMetaData(java.lang.String mmbClassName,
                   java.lang.String resourceClassName,
                   java.lang.String url)
            throws java.net.MalformedURLException
Constructs an aggregate XML builder implementation.

Parameters:
mmbClassName - the class name of the Model MBean implementation
resourceClassName - the class name of the resource object the Model MBean represents
url - the URL for the XML definition of the management interface
Throws:
java.net.MalformedURLException - if the URL string could not be resolved

XMLMetaData

public XMLMetaData(java.lang.String mmbClassName,
                   java.lang.String resourceClassName,
                   java.net.URL url,
                   java.util.Map properties)
Constructs an aggregate XML builder implementation.

Parameters:
mmbClassName - the class name of the Model MBean implementation
resourceClassName - the class name of the resource object the Model MBean represents
url - the URL for the XML definition of the management interface
properties - Map of configuration properties for this builder. These properties will be passed to the appropriate XML schema specific builder when it is created.

XMLMetaData

public XMLMetaData(java.lang.String mmbClassName,
                   java.lang.String resourceClassName,
                   java.lang.String url,
                   java.util.Map properties)
            throws java.net.MalformedURLException
Constructs an aggregate XML builder implementation.

Parameters:
mmbClassName - the class name of the Model MBean implementation
resourceClassName - the class name of the resource object the Model MBean represents
url - the URL for the XML definition of the management interface
properties - Map of configuration properties for this builder. These properties will be passed to the appropriate XML schema specific builder when it is created.
Throws:
java.net.MalformedURLException - if the URL string could not be resolved

XMLMetaData

public XMLMetaData(java.lang.String mmbClassName,
                   java.lang.String resourceClassName,
                   Element element,
                   java.lang.String version)
Creates a new XMLMetaData instance using an explicit DOM element as the configuration source, and requiring an explicit version indicator. The version should be the PublicID for the dtd or (worse) the dtd url.

Parameters:
mmbClassName - a String value
resourceClassName - a String value
element - an org.w3c.dom.Element value
version - a String value
Method Detail

build

public MBeanInfo (src)  build()
                throws NotCompliantMBeanException (src) 
Constructs the Model MBean metadata. This implementation reads the document type definition from the beginning of the XML file and picks a corresponding XML builder based on the schema name. In case no document type is defined the latest schema builder for this JBossMX release is used.

The SAX parser implementation is selected by default based on JAXP configuration. If you want to use JAXP to select the parser, you can set the system property "javax.xml.parsers.SAXParserFactory". For example, to use Xerces you might define:


    java -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl ...

 
In case you can't or don't want to use JAXP to configure the SAX parser implementation you can override the SAX parser implementation by setting an MBean descriptor field XMBeanConstants.SAX_PARSER to the parser class string value.

Specified by:
build in interface MetaDataBuilder (src)
Specified by:
build in class AbstractBuilder (src)
Returns:
initialized MBean info
Throws:
NotCompliantMBeanException (src) - if there were errors building the MBean info from the given XML file.