Class SpringModelMBean
java.lang.Object
javax.management.modelmbean.RequiredModelMBean
org.springframework.jmx.export.SpringModelMBean
- All Implemented Interfaces:
- DynamicMBean,- MBeanRegistration,- ModelMBean,- ModelMBeanNotificationBroadcaster,- NotificationBroadcaster,- NotificationEmitter,- PersistentMBean
Extension of the 
RequiredModelMBean class that ensures the
 thread context ClassLoader is switched
 for the managed resource's ClassLoader before any invocations occur.- Since:
- 2.0
- Author:
- Rob Harrop
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionConstruct a new SpringModelMBean instance with an emptyModelMBeanInfo.Construct a new SpringModelMBean instance with the givenModelMBeanInfo.
- 
Method SummaryModifier and TypeMethodDescriptiongetAttribute(String attrName) Switches thecontext ClassLoaderfor the managed resourcesClassLoaderbefore allowing the invocation to occur.getAttributes(String[] attrNames) Switches thecontext ClassLoaderfor the managed resourcesClassLoaderbefore allowing the invocation to occur.Switches thecontext ClassLoaderfor the managed resourcesClassLoaderbefore allowing the invocation to occur.voidsetAttribute(Attribute attribute) Switches thecontext ClassLoaderfor the managed resourcesClassLoaderbefore allowing the invocation to occur.setAttributes(AttributeList attributes) Switches thecontext ClassLoaderfor the managed resourcesClassLoaderbefore allowing the invocation to occur.voidsetManagedResource(Object managedResource, String managedResourceType) Sets managed resource to expose and stores itsClassLoader.Methods inherited from class javax.management.modelmbean.RequiredModelMBeanaddAttributeChangeNotificationListener, addNotificationListener, getClassLoaderRepository, getMBeanInfo, getNotificationInfo, load, postDeregister, postRegister, preDeregister, preRegister, removeAttributeChangeNotificationListener, removeNotificationListener, removeNotificationListener, sendAttributeChangeNotification, sendAttributeChangeNotification, sendNotification, sendNotification, setModelMBeanInfo, store
- 
Constructor Details- 
SpringModelMBeanConstruct a new SpringModelMBean instance with an emptyModelMBeanInfo.- Throws:
- MBeanException
- RuntimeOperationsException
- See Also:
 
- 
SpringModelMBeanConstruct a new SpringModelMBean instance with the givenModelMBeanInfo.- Throws:
- MBeanException
- RuntimeOperationsException
- See Also:
 
 
- 
- 
Method Details- 
setManagedResourcepublic void setManagedResource(Object managedResource, String managedResourceType) throws MBeanException, InstanceNotFoundException, InvalidTargetObjectTypeException Sets managed resource to expose and stores itsClassLoader.- Specified by:
- setManagedResourcein interface- ModelMBean
- Overrides:
- setManagedResourcein class- RequiredModelMBean
- Throws:
- MBeanException
- InstanceNotFoundException
- InvalidTargetObjectTypeException
 
- 
invokepublic Object invoke(String opName, Object[] opArgs, String[] sig) throws MBeanException, ReflectionException Switches thecontext ClassLoaderfor the managed resourcesClassLoaderbefore allowing the invocation to occur.- Specified by:
- invokein interface- DynamicMBean
- Overrides:
- invokein class- RequiredModelMBean
- Throws:
- MBeanException
- ReflectionException
- See Also:
 
- 
getAttributepublic Object getAttribute(String attrName) throws AttributeNotFoundException, MBeanException, ReflectionException Switches thecontext ClassLoaderfor the managed resourcesClassLoaderbefore allowing the invocation to occur.- Specified by:
- getAttributein interface- DynamicMBean
- Overrides:
- getAttributein class- RequiredModelMBean
- Throws:
- AttributeNotFoundException
- MBeanException
- ReflectionException
- See Also:
 
- 
getAttributesSwitches thecontext ClassLoaderfor the managed resourcesClassLoaderbefore allowing the invocation to occur.- Specified by:
- getAttributesin interface- DynamicMBean
- Overrides:
- getAttributesin class- RequiredModelMBean
- See Also:
 
- 
setAttributepublic void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException Switches thecontext ClassLoaderfor the managed resourcesClassLoaderbefore allowing the invocation to occur.- Specified by:
- setAttributein interface- DynamicMBean
- Overrides:
- setAttributein class- RequiredModelMBean
- Throws:
- AttributeNotFoundException
- InvalidAttributeValueException
- MBeanException
- ReflectionException
- See Also:
 
- 
setAttributesSwitches thecontext ClassLoaderfor the managed resourcesClassLoaderbefore allowing the invocation to occur.- Specified by:
- setAttributesin interface- DynamicMBean
- Overrides:
- setAttributesin class- RequiredModelMBean
- See Also:
 
 
-