类 SpringModelMBean
- java.lang.Object
- javax.management.modelmbean.RequiredModelMBean
- org.springframework.jmx.export.SpringModelMBean
- 所有已实现的接口:
DynamicMBean
,MBeanRegistration
,ModelMBean
,ModelMBeanNotificationBroadcaster
,NotificationBroadcaster
,NotificationEmitter
,PersistentMBean
public class SpringModelMBean extends RequiredModelMBean
Extension of theRequiredModelMBean
class that ensures thethread context ClassLoader
is switched for the managed resource'sClassLoader
before any invocations occur.- 从以下版本开始:
- 2.0
- 作者:
- Rob Harrop
- 另请参阅:
RequiredModelMBean
构造器概要
构造器 构造器 说明 SpringModelMBean()
Construct a new SpringModelMBean instance with an emptyModelMBeanInfo
.SpringModelMBean(ModelMBeanInfo mbi)
Construct a new SpringModelMBean instance with the givenModelMBeanInfo
.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Object
getAttribute(String attrName)
Switches thecontext ClassLoader
for the managed resourcesClassLoader
before allowing the invocation to occur.AttributeList
getAttributes(String[] attrNames)
Switches thecontext ClassLoader
for the managed resourcesClassLoader
before allowing the invocation to occur.Object
invoke(String opName, Object[] opArgs, String[] sig)
Switches thecontext ClassLoader
for the managed resourcesClassLoader
before allowing the invocation to occur.void
setAttribute(Attribute attribute)
Switches thecontext ClassLoader
for the managed resourcesClassLoader
before allowing the invocation to occur.AttributeList
setAttributes(AttributeList attributes)
Switches thecontext ClassLoader
for the managed resourcesClassLoader
before allowing the invocation to occur.void
setManagedResource(Object managedResource, String managedResourceType)
Sets managed resource to expose and stores itsClassLoader
.从类继承的方法 javax.management.modelmbean.RequiredModelMBean
addAttributeChangeNotificationListener, addNotificationListener, getClassLoaderRepository, getMBeanInfo, getNotificationInfo, load, postDeregister, postRegister, preDeregister, preRegister, removeAttributeChangeNotificationListener, removeNotificationListener, removeNotificationListener, sendAttributeChangeNotification, sendAttributeChangeNotification, sendNotification, sendNotification, setModelMBeanInfo, store
构造器详细资料
SpringModelMBean
public SpringModelMBean() throws MBeanException, RuntimeOperationsException
Construct a new SpringModelMBean instance with an emptyModelMBeanInfo
.
SpringModelMBean
public SpringModelMBean(ModelMBeanInfo mbi) throws MBeanException, RuntimeOperationsException
Construct a new SpringModelMBean instance with the givenModelMBeanInfo
.
方法详细资料
setManagedResource
public void setManagedResource(Object managedResource, String managedResourceType) throws MBeanException, InstanceNotFoundException, InvalidTargetObjectTypeException
Sets managed resource to expose and stores itsClassLoader
.
invoke
public Object invoke(String opName, Object[] opArgs, String[] sig) throws MBeanException, ReflectionException
Switches thecontext ClassLoader
for the managed resourcesClassLoader
before allowing the invocation to occur.
getAttribute
public Object getAttribute(String attrName) throws AttributeNotFoundException, MBeanException, ReflectionException
Switches thecontext ClassLoader
for the managed resourcesClassLoader
before allowing the invocation to occur.
getAttributes
public AttributeList getAttributes(String[] attrNames)
Switches thecontext ClassLoader
for the managed resourcesClassLoader
before allowing the invocation to occur.
setAttribute
public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException
Switches thecontext ClassLoader
for the managed resourcesClassLoader
before allowing the invocation to occur.
setAttributes
public AttributeList setAttributes(AttributeList attributes)
Switches thecontext ClassLoader
for the managed resourcesClassLoader
before allowing the invocation to occur.