org.mule.module.management.agent
Class ClassloaderSwitchingMBeanWrapper
java.lang.Object
javax.management.StandardMBean
org.mule.module.management.agent.ClassloaderSwitchingMBeanWrapper
- All Implemented Interfaces:
- DynamicMBean, MBeanRegistration
public class ClassloaderSwitchingMBeanWrapper
- extends StandardMBean
- implements MBeanRegistration
Ensures any external jmx invocation (like e.g. remote) is executed with a correct application
classloader (otherwise a bootstrap classloader is used by default for platform mbean server). Note
the irony - extends StandardMBean, but StandardMBean is not your 'standard mbean', but rather a
special kind of the DynamicMBean which generates attributes/operations based on the passed in
interface (via reflection).
Methods inherited from class javax.management.StandardMBean |
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getImpact, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, getParameterName, getParameterName, setAttribute, setAttributes, setImplementation |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected Log logger
ClassloaderSwitchingMBeanWrapper
public ClassloaderSwitchingMBeanWrapper(T implementation,
Class<T> mbeanInterface,
ClassLoader executionClassLoader)
throws NotCompliantMBeanException
- Throws:
NotCompliantMBeanException
invoke
public Object invoke(String actionName,
Object[] params,
String[] signature)
throws MBeanException,
ReflectionException
- Specified by:
invoke
in interface DynamicMBean
- Overrides:
invoke
in class StandardMBean
- Throws:
MBeanException
ReflectionException
getExecutionClassLoader
public ClassLoader getExecutionClassLoader()
setExecutionClassLoader
public void setExecutionClassLoader(ClassLoader executionClassLoader)
preRegister
public ObjectName preRegister(MBeanServer server,
ObjectName name)
throws Exception
- Specified by:
preRegister
in interface MBeanRegistration
- Overrides:
preRegister
in class StandardMBean
- Throws:
Exception
postRegister
public void postRegister(Boolean registrationDone)
- Specified by:
postRegister
in interface MBeanRegistration
- Overrides:
postRegister
in class StandardMBean
preDeregister
public void preDeregister()
throws Exception
- Specified by:
preDeregister
in interface MBeanRegistration
- Overrides:
preDeregister
in class StandardMBean
- Throws:
Exception
postDeregister
public void postDeregister()
- Specified by:
postDeregister
in interface MBeanRegistration
- Overrides:
postDeregister
in class StandardMBean
Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.