|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.mx.server.AbstractMBeanInvoker org.jboss.mx.modelmbean.ModelMBeanInvoker org.jboss.mx.modelmbean.XMBean
XMBean implementation.
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 |
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 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 |
public XMBean() throws MBeanException
public XMBean(ModelMBeanInfo info) throws MBeanException
info
- Model MBean metadata describing this MBean templatepublic XMBean(Object resource, String resourceType) throws MBeanException, NotCompliantMBeanException
This Model MBean implementation supports the following resource types:
-OBJECT_REF: resource object can be any Java object. The management interface must be set separately viaOBJECT_REF
-STANDARD_INTERFACE
-DESCRIPTOR
- Any valid URL string to a *.xml file.
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.
resource
- resource object or descriptorresourceType
- resource type string or URL to *.xml filepublic XMBean(Object resource, URL interfaceURL) throws MBeanException, NotCompliantMBeanException
public XMBean(Descriptor descriptor) throws MBeanException, NotCompliantMBeanException
public XMBean(Object resource, Element element, String version) throws MBeanException, NotCompliantMBeanException
public XMBean(Object resource, org.dom4j.Element element, String version) throws MBeanException, NotCompliantMBeanException
Method Detail |
public boolean isSupportedResourceType(Object resource, String resourceType)
isSupportedResourceType
in class ModelMBeanInvoker
protected void configureInterceptorStack(ModelMBeanInfo info, MBeanServer server, ObjectName name) throws Exception
ModelMBeanInvoker
configureInterceptorStack
in class ModelMBeanInvoker
info
- - the ModelMBean metadataserver
- - the MBeanServer the ModelMBean is registering withname
- - the ModelMBean name
Exception
public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
NotificationBroadcaster
addNotificationListener
in interface NotificationBroadcaster
addNotificationListener
in class ModelMBeanInvoker
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
NotificationBroadcaster
removeNotificationListener
in interface NotificationBroadcaster
removeNotificationListener
in class ModelMBeanInvoker
ListenerNotFoundException
public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException
NotificationEmitter
Only the listener, filter, handback triplet is removed
removeNotificationListener
in interface NotificationEmitter
removeNotificationListener
in class ModelMBeanInvoker
ListenerNotFoundException
public MBeanNotificationInfo[] getNotificationInfo()
NotificationBroadcaster
getNotificationInfo
in interface NotificationBroadcaster
getNotificationInfo
in class ModelMBeanInvoker
public void handleNotification(Notification notification, Object handback)
handleNotification
in interface NotificationListener
notification
- the notification objecthandback
- the handback object given to the broadcaster
upon listener registration
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |