Class StandardMBean
- All Implemented Interfaces:
DynamicMBean,MBeanRegistration
- Direct Known Subclasses:
ContextMonitor,Request,SelfAwareMBean
StandardMBean,
and support its public and protected API while addressing some gaps therein.
Specifically, this class provides localized descriptions and operation parameter
names when resource bundles produced by MBeanInterfaceProcessor
are accessible. It also provides
operation impact when this is conveyed via MBeanOperationImpact
annotations. Further, it provides per-implementation class caching of MBeanInfo
in addition to the per-instance caching provided by StandardMBean.
Finally, it automatically uses the MBeanNotificationInfo produced by getNotificationInfo()
for subclasses that implement NotificationBroadcaster.
Due to these improvements, this class should be used as the basis for all Windchill MBeans
(apart from special cases like DynamicMBeanProxy).
Note: Though it may (or may not) be the case at this moment, no one should assume that this class does (or does not) extend javax.management.StandardMBean. They can rely on this class supporting the public and protected methods exposed by javax.management.StandardMBean and its base classes remaining exposed, however.
Do note, however, that this class explicitly does not support usage of setImplementation() from one thread while other threads may be calling methods on the same instance. Specifically, in the case that the instance's MBeanInfo is should change due to setImplementation() such changes may not occur. The authors of the JMX spec consider this particular usage scenario ill-advised and supporting this robustly has adverse performance implications. Therefore this practice is simply not supported by this class. This class should be considered thread safe as long as one completes any such use of setImplementation() prior to handing the instance to other threads, however.
Finally note that the Descriptor of the MBeanInfo produced by this
class will denote "immutableInfo" as "true" by default. Subclasses will need
to override this if their MBeanInfo is actually mutable.
Supported API: true
Extendable: true
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedStandardMBean(Class<?> mbeanInterface) Pass through constructor.protectedStandardMBean(Class<?> mbeanInterface, boolean isMXBean) Pass through constructor.StandardMBean(T implementation, Class<T> mbeanInterface) Pass through constructor.StandardMBean(T implementation, Class<T> mbeanInterface, boolean isMXBean) Pass through constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcacheMBeanInfo(MBeanInfo info) Cache MBeanInfo in this instance and in per implementation class cache as well.protected voidExposes javax.management.StandardMBean.cacheMBeanInfo() to subclasses so they can cache their MBeanInfo directly in this instance object without introducing another field.protected MBeanInfocreateMBeanInfo(MBeanInfo baseClassMBeanInfo) This method is intended for sub-classes to override without worrying about caching policies, etc.voidemailThisMBean(String addressesOrEmailList, String subject, boolean includeChildren) Note this implementation is provided for subclasses, but will not function unless subclassed such that a public getObjectName() method is provided that returns the ObjectName of this MBean and Emailer and Dumper MBeans have been instantiated and started for this MBean to use and are accessible via the local class loader.getAttributes(String[] attributes) Overriden asStandardMBeandoes not otherwise necessarily delegate this object's getAttribute() method, whereas various subclasses of this class depend upon such behavior and such behavior seems like most logical and consistent all around.protected MBeanInfoExposes javax.management.StandardMBean.getCachedMBeanInfo() to subclasses so they can access cached MBeanInfo directly in this instance object without introducing another field.protected MBeanInfoGet cached MBeanInfo.protected StringSeeStandardMBean.protected StringgetDescription(MBeanInfo info) SeeStandardMBean.protected StringSeeStandardMBean.protected StringgetDescription(MBeanOperationInfo op, MBeanParameterInfo param, int sequence) SeeStandardMBean.protected intgetImpact(MBeanOperationInfo info) SeeStandardMBean.Overriden to fix JDK StandardMBean's lack of proper getNotificationInfo() support.protected StringgetParameterName(MBeanOperationInfo op, MBeanParameterInfo param, int sequence) SeeStandardMBean.setAttributes(AttributeList attributes) Overriden asStandardMBeandoes not otherwise necessarily delegate this object's setAttribute() method, whereas various subclasses of this class depend upon such behavior and such behavior seems like most logical and consistent all around.Methods inherited from class javax.management.StandardMBean
getAttribute, getClassName, getConstructors, getDescription, getDescription, getDescription, getImplementation, getImplementationClass, getMBeanInterface, getParameterName, invoke, postDeregister, postRegister, preDeregister, preRegister, setAttribute, setImplementation
-
Constructor Details
-
StandardMBean
Pass through constructor.
Supported API: true- Throws:
NotCompliantMBeanException
-
StandardMBean
Pass through constructor.
Supported API: true -
StandardMBean
Pass through constructor.
Supported API: true- Throws:
NotCompliantMBeanException
-
StandardMBean
Pass through constructor.
Supported API: true
-
-
Method Details
-
getAttributes
Overriden asStandardMBeandoes not otherwise necessarily delegate this object's getAttribute() method, whereas various subclasses of this class depend upon such behavior and such behavior seems like most logical and consistent all around.
Supported API: true- Specified by:
getAttributesin interfaceDynamicMBean- Overrides:
getAttributesin classStandardMBean
-
setAttributes
Overriden asStandardMBeandoes not otherwise necessarily delegate this object's setAttribute() method, whereas various subclasses of this class depend upon such behavior and such behavior seems like most logical and consistent all around.
Supported API: true- Specified by:
setAttributesin interfaceDynamicMBean- Overrides:
setAttributesin classStandardMBean
-
emailThisMBean
public void emailThisMBean(String addressesOrEmailList, String subject, boolean includeChildren) throws Exception Note this implementation is provided for subclasses, but will not function unless subclassed such that a public getObjectName() method is provided that returns the ObjectName of this MBean and Emailer and Dumper MBeans have been instantiated and started for this MBean to use and are accessible via the local class loader.It should be clear that this is really a convenience method for calling Dumper's emailMBeans() operation (always applying the default XSLT styling and not compressing) with this MBean's ObjectName and appending ",*" to this if 'includeChildren' is true.
Supported API: true- Throws:
Exception
-
getMBeanInfo
Overriden to fix JDK StandardMBean's lack of proper getNotificationInfo() support.Note: To override/augment/amend this MBeanInfo, but still use this classes' per-class caching strategy, override createMBeanInfo() instead. On the other hand, to use a different, overlaid caching strategy override this routine and call this implementation to get the base standard MBean info.
Supported API: true- Specified by:
getMBeanInfoin interfaceDynamicMBean- Overrides:
getMBeanInfoin classStandardMBean
-
createMBeanInfo
This method is intended for sub-classes to override without worrying about caching policies, etc.No cache access should be performed herein. Also, in general, the first line of an override of this method should be
baseClassMBeanInfo = super.createMBeanInfo( baseClassMBeanInfo );
unless one has a good reason to override additions/adjustments made by super classes.
Supported API: true -
getCachedInstanceMBeanInfo
Exposes javax.management.StandardMBean.getCachedMBeanInfo() to subclasses so they can access cached MBeanInfo directly in this instance object without introducing another field. See also cacheMBeanInfoInInstance().
Supported API: true -
getCachedMBeanInfo
Get cached MBeanInfo. Note this class caches MBeanInfo per implementation class and this will be checked if the given instance does not have its own cached MBeanInfo.
Supported API: true- Overrides:
getCachedMBeanInfoin classStandardMBean
-
cacheMBeanInfoInInstance
Exposes javax.management.StandardMBean.cacheMBeanInfo() to subclasses so they can cache their MBeanInfo directly in this instance object without introducing another field. See also getCachedInstanceMBeanInfo() to access the result.
Supported API: true -
cacheMBeanInfo
Cache MBeanInfo in this instance and in per implementation class cache as well.
Supported API: true- Overrides:
cacheMBeanInfoin classStandardMBean
-
getDescription
- Overrides:
getDescriptionin classStandardMBean
-
getDescription
- Overrides:
getDescriptionin classStandardMBean
-
getDescription
- Overrides:
getDescriptionin classStandardMBean
-
getDescription
- Overrides:
getDescriptionin classStandardMBean
-
getParameterName
- Overrides:
getParameterNamein classStandardMBean
-
getImpact
- Overrides:
getImpactin classStandardMBean
-