站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 jmx API Documentation 英文版文档

XMBean (JBoss/JMX API) - JBoss 4.0.1 sp1 jmx API Documentation 英文版文档


org.jboss.mx.modelmbean
Class XMBean

java.lang.Object
  extended byorg.jboss.mx.server.AbstractMBeanInvoker
      extended byorg.jboss.mx.modelmbean.ModelMBeanInvoker
          extended byorg.jboss.mx.modelmbean.XMBean
All Implemented Interfaces:
DynamicMBean, EventListener, MBeanInvoker, MBeanRegistration, ModelMBean, ModelMBeanConstants, ModelMBeanNotificationBroadcaster, NotificationBroadcaster, NotificationEmitter, NotificationListener, PersistentMBean, Suspendable, XMBeanConstants

public class XMBean
extends ModelMBeanInvoker
implements XMBeanConstants, NotificationListener

XMBean implementation.

Version:
$Revision: 1.28.2.3 $
Author:
Juha Lindfors., Matt Munz, Dimitris Andreadis

Nested Class Summary
 
Nested classes inherited from class org.jboss.mx.server.AbstractMBeanInvoker
AbstractMBeanInvoker.OperationKey
 
Field Summary
 
Fields inherited from class org.jboss.mx.modelmbean.ModelMBeanInvoker
attrNotifierSequence, notifier, notifierSequence, persistence, resourceType
 
Fields inherited from class org.jboss.mx.server.AbstractMBeanInvoker
attributeContextMap, constructorContextMap, dynamicResource, getMBeanInfoCtx, info, operationContextMap, postDeregisterCtx, postRegisterCtx, preDeregisterCtx, preRegisterCtx, resourceEntry
 
Fields inherited from interface org.jboss.mx.modelmbean.XMBeanConstants
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
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
XMBean()
          Default constructor for the XMBean Model MBean implementation.
XMBean(Descriptor descriptor)
           
XMBean(ModelMBeanInfo info)
          Creates an XMBean Model MBean implementation with a predefined JMX metadata.
XMBean(Object resource, Element element, String version)
           
XMBean(Object resource, org.dom4j.Element element, String version)
           
XMBean(Object resource, String resourceType)
          Creates a XMBean instance with a given resource object and resource type.
XMBean(Object resource, URL interfaceURL)
           
 
Method Summary
 void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
          Add a listener to an MBean.
protected  void configureInterceptorStack(ModelMBeanInfo info, MBeanServer server, ObjectName name)
          Build the getMBeanInfo, operation, and attribute interceptor stacks and associated these with the corresponding InvocationContexts.
 MBeanNotificationInfo[] getNotificationInfo()
          Returns the notification metadata associated with the MBean.
 void handleNotification(Notification notification, Object handback)
          Implements NotificationListener interface by simply forwarding any received Notification to the wrapped resource, if it implements the NotificationListener interface, too.
 boolean isSupportedResourceType(Object resource, String resourceType)
           
 void removeNotificationListener(NotificationListener listener)
          Removes a listener from an MBean.
 void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
          Removes a listener from the Emitter.
 
Methods inherited from class org.jboss.mx.modelmbean.ModelMBeanInvoker
addAttributeChangeNotificationListener, getInterceptors, init, initAttributeContexts, initOperationContexts, initPersistence, invokePreRegister, load, override, removeAttributeChangeNotificationListener, sendAttributeChangeNotification, sendAttributeChangeNotification, sendNotification, sendNotification, setManagedResource, setModelMBeanInfo, setValuesFromMBeanInfo, store
 
Methods inherited from class org.jboss.mx.server.AbstractMBeanInvoker
addNotificationListenerToResource, getAttribute, getAttributes, getInvocationTimeout, getMBeanEntry, getMBeanInfo, getMetaData, getNotificationInfoFromResource, getObjectName, getResource, getServer, getSignatureString, initDispatchers, inject, invoke, invokePostDeregister, invokePostRegister, invokePreDeregister, isSuspended, postDeregister, postRegister, preDeregister, preRegister, removeNotificationListenerFromResource, removeNotificationListenerFromResource, resume, setAttribute, setAttributes, setInvocationTimeout, setMBeanEntry, setResource, suspend, suspend, suspend, updateAttributeInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.management.DynamicMBean
getAttribute, getAttributes, getMBeanInfo, invoke, setAttribute, setAttributes
 

Constructor Detail

XMBean

public XMBean()
       throws MBeanException
Default constructor for the XMBean Model MBean implementation. This creates an uninitialized Model MBean template.


XMBean

public XMBean(ModelMBeanInfo info)
       throws MBeanException
Creates an XMBean Model MBean implementation with a predefined JMX metadata.

Parameters:
info - Model MBean metadata describing this MBean template

XMBean

public XMBean(Object resource,
              String resourceType)
       throws MBeanException,
              NotCompliantMBeanException
Creates a XMBean instance with a given resource object and resource type.

This Model MBean implementation supports the following resource types:


   - OBJECT_REF
   - STANDARD_INTERFACE
   - DESCRIPTOR
   - Any valid URL string to a *.xml file.

 
OBJECT_REF: resource object can be any Java object. The management interface must be set separately via setModelMBeanInfo method.

STANDARD_INTERFACE: the resource object is assumed to follow the Standard MBean naming conventions to expose its management interface, including implementing a xxxMBean interface. A corresponding Model MBean metadata is generated for the Model MBean representing this resource type.

DESCRIPTOR: the resource object is wrapped as a part of the Descriptor object passed to this Model MBean instance. The descriptor object must contain the mandatory fields RESOURCE_REFERENCE and RESOURCE_TYPE that identify the correct resource reference and type used for this Model MBean instance. The descriptor object may also contain additional fields, such as SAX_PARSER and XML_VALIDATION that are passed as configuration properties for the metadata builder instances. Any additional descriptor fields that match the METADATA_DESCRIPTOR_PREFIX naming pattern will be passed to the builder implementation via its setProperty method.

URL String: if a resource type string contains an URL that ends with a *.xml file name the resource object is exposed via the XML management interface definition read from this URL. The XML parser implementation is picked based on the schema definition in the XML document.

Parameters:
resource - resource object or descriptor
resourceType - resource type string or URL to *.xml file

XMBean

public XMBean(Object resource,
              URL interfaceURL)
       throws MBeanException,
              NotCompliantMBeanException

XMBean

public XMBean(Descriptor descriptor)
       throws MBeanException,
              NotCompliantMBeanException

XMBean

public XMBean(Object resource,
              Element element,
              String version)
       throws MBeanException,
              NotCompliantMBeanException

XMBean

public XMBean(Object resource,
              org.dom4j.Element element,
              String version)
       throws MBeanException,
              NotCompliantMBeanException
Method Detail

isSupportedResourceType

public boolean isSupportedResourceType(Object resource,
                                       String resourceType)
Overrides:
isSupportedResourceType in class ModelMBeanInvoker

configureInterceptorStack

protected void configureInterceptorStack(ModelMBeanInfo info,
                                         MBeanServer server,
                                         ObjectName name)
                                  throws Exception
Description copied from class: ModelMBeanInvoker
Build the getMBeanInfo, operation, and attribute interceptor stacks and associated these with the corresponding InvocationContexts.

Overrides:
configureInterceptorStack in class ModelMBeanInvoker
Parameters:
info - - the ModelMBean metadata
server - - the MBeanServer the ModelMBean is registering with
name - - the ModelMBean name
Throws:
Exception

addNotificationListener

public void addNotificationListener(NotificationListener listener,
                                    NotificationFilter filter,
                                    Object handback)
Description copied from interface: NotificationBroadcaster
Add a listener to an MBean.

Specified by:
addNotificationListener in interface NotificationBroadcaster
Overrides:
addNotificationListener in class ModelMBeanInvoker

removeNotificationListener

public void removeNotificationListener(NotificationListener listener)
                                throws ListenerNotFoundException
Description copied from interface: NotificationBroadcaster
Removes a listener from an MBean.

Specified by:
removeNotificationListener in interface NotificationBroadcaster
Overrides:
removeNotificationListener in class ModelMBeanInvoker
Throws:
ListenerNotFoundException

removeNotificationListener

public void removeNotificationListener(NotificationListener listener,
                                       NotificationFilter filter,
                                       Object handback)
                                throws ListenerNotFoundException
Description copied from interface: NotificationEmitter
Removes a listener from the Emitter.

Only the listener, filter, handback triplet is removed

Specified by:
removeNotificationListener in interface NotificationEmitter
Overrides:
removeNotificationListener in class ModelMBeanInvoker
Throws:
ListenerNotFoundException

getNotificationInfo

public MBeanNotificationInfo[] getNotificationInfo()
Description copied from interface: NotificationBroadcaster
Returns the notification metadata associated with the MBean.

Specified by:
getNotificationInfo in interface NotificationBroadcaster
Overrides:
getNotificationInfo in class ModelMBeanInvoker

handleNotification

public void handleNotification(Notification notification,
                               Object handback)
Implements NotificationListener interface by simply forwarding any received Notification to the wrapped resource, if it implements the NotificationListener interface, too. This is needed to allow the wrapped resource to register for Notifications using the XMBean ObjectName, rather than its own "this" reference - dimitris

Specified by:
handleNotification in interface NotificationListener
Parameters:
notification - the notification object
handback - the handback object given to the broadcaster upon listener registration


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.