public class DynamicInterceptor extends Object implements MBeanServer
When instantiated at startup, the instance of this class that wraps the real MBeanServer is termed the "Primary Interceptor". There can only be one such Interceptor for each real* MBeanServer. MBeanServer #0 is the Platform MBeanServer, and this class must be used for GlassFish. Additional MBeanServers can be created if desired.
This class can also be used to implement an Interceptor which can be set for use by the Primary Interceptor. Such interceptors are used only for get/setAttribute(s) and invoke(), though the use of them could be expanded for other methods.
Note that many methods are declared 'final' for efficiency. If a subclass needs to override a method, remove 'final'. Until that time, we might as well remain efficient, since most methods won't be overridden.
Constructor and Description |
---|
DynamicInterceptor() |
public MBeanServer getDelegateMBeanServer()
public void setDelegateMBeanServer(MBeanServer server)
public Object invoke(ObjectName objectName, String operationName, Object[] params, String[] signature) throws ReflectionException, InstanceNotFoundException, MBeanException
invoke
in interface MBeanServer
invoke
in interface MBeanServerConnection
ReflectionException
InstanceNotFoundException
MBeanException
public final Object getAttribute(ObjectName objectName, String attributeName) throws InstanceNotFoundException, AttributeNotFoundException, MBeanException, ReflectionException
getAttribute
in interface MBeanServer
getAttribute
in interface MBeanServerConnection
InstanceNotFoundException
AttributeNotFoundException
MBeanException
ReflectionException
public void setAttribute(ObjectName objectName, Attribute attribute) throws InstanceNotFoundException, AttributeNotFoundException, MBeanException, ReflectionException, InvalidAttributeValueException
setAttribute
in interface MBeanServer
setAttribute
in interface MBeanServerConnection
InstanceNotFoundException
AttributeNotFoundException
MBeanException
ReflectionException
InvalidAttributeValueException
public final AttributeList getAttributes(ObjectName objectName, String[] attrNames) throws InstanceNotFoundException, ReflectionException
getAttributes
in interface MBeanServer
getAttributes
in interface MBeanServerConnection
InstanceNotFoundException
ReflectionException
public AttributeList setAttributes(ObjectName objectName, AttributeList attributeList) throws InstanceNotFoundException, ReflectionException
setAttributes
in interface MBeanServer
setAttributes
in interface MBeanServerConnection
InstanceNotFoundException
ReflectionException
public final ObjectInstance registerMBean(Object obj, ObjectName objectName) throws NotCompliantMBeanException, MBeanRegistrationException, InstanceAlreadyExistsException
registerMBean
in interface MBeanServer
NotCompliantMBeanException
MBeanRegistrationException
InstanceAlreadyExistsException
public final void unregisterMBean(ObjectName objectName) throws InstanceNotFoundException, MBeanRegistrationException
unregisterMBean
in interface MBeanServer
unregisterMBean
in interface MBeanServerConnection
InstanceNotFoundException
MBeanRegistrationException
public final Integer getMBeanCount()
getMBeanCount
in interface MBeanServer
getMBeanCount
in interface MBeanServerConnection
public final Set queryMBeans(ObjectName objectName, QueryExp expr)
queryMBeans
in interface MBeanServer
queryMBeans
in interface MBeanServerConnection
public final MBeanInfo getMBeanInfo(ObjectName objectName) throws InstanceNotFoundException, IntrospectionException, ReflectionException
getMBeanInfo
in interface MBeanServer
getMBeanInfo
in interface MBeanServerConnection
InstanceNotFoundException
IntrospectionException
ReflectionException
public final boolean isRegistered(ObjectName objectName)
isRegistered
in interface MBeanServer
isRegistered
in interface MBeanServerConnection
public final void addNotificationListener(ObjectName objectName, NotificationListener notificationListener, NotificationFilter notificationFilter, Object obj) throws InstanceNotFoundException
addNotificationListener
in interface MBeanServer
addNotificationListener
in interface MBeanServerConnection
InstanceNotFoundException
public final void addNotificationListener(ObjectName objectName, ObjectName objectName1, NotificationFilter notificationFilter, Object obj) throws InstanceNotFoundException
addNotificationListener
in interface MBeanServer
addNotificationListener
in interface MBeanServerConnection
InstanceNotFoundException
public final ObjectInstance createMBean(String str, ObjectName objectName) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException
createMBean
in interface MBeanServer
createMBean
in interface MBeanServerConnection
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
public final ObjectInstance createMBean(String str, ObjectName objectName, ObjectName objectName2) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException
createMBean
in interface MBeanServer
createMBean
in interface MBeanServerConnection
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
InstanceNotFoundException
public final ObjectInstance createMBean(String str, ObjectName objectName, Object[] obj, String[] str3) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException
createMBean
in interface MBeanServer
createMBean
in interface MBeanServerConnection
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
public final ObjectInstance createMBean(String str, ObjectName objectName, ObjectName objectName2, Object[] obj, String[] str4) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException
createMBean
in interface MBeanServer
createMBean
in interface MBeanServerConnection
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
InstanceNotFoundException
public final ObjectInputStream deserialize(String str, byte[] values) throws OperationsException, ReflectionException
deserialize
in interface MBeanServer
OperationsException
ReflectionException
public final ObjectInputStream deserialize(ObjectName objectName, byte[] values) throws InstanceNotFoundException, OperationsException
deserialize
in interface MBeanServer
InstanceNotFoundException
OperationsException
public final ObjectInputStream deserialize(String str, ObjectName objectName, byte[] values) throws InstanceNotFoundException, OperationsException, ReflectionException
deserialize
in interface MBeanServer
InstanceNotFoundException
OperationsException
ReflectionException
public final String getDefaultDomain()
getDefaultDomain
in interface MBeanServer
getDefaultDomain
in interface MBeanServerConnection
public final ObjectInstance getObjectInstance(ObjectName objectName) throws InstanceNotFoundException
getObjectInstance
in interface MBeanServer
getObjectInstance
in interface MBeanServerConnection
InstanceNotFoundException
public final Object instantiate(String str) throws ReflectionException, MBeanException
instantiate
in interface MBeanServer
ReflectionException
MBeanException
public final Object instantiate(String str, ObjectName objectName) throws ReflectionException, MBeanException, InstanceNotFoundException
instantiate
in interface MBeanServer
ReflectionException
MBeanException
InstanceNotFoundException
public final Object instantiate(String str, Object[] obj, String[] str2) throws ReflectionException, MBeanException
instantiate
in interface MBeanServer
ReflectionException
MBeanException
public final Object instantiate(String str, ObjectName objectName, Object[] obj, String[] str3) throws ReflectionException, MBeanException, InstanceNotFoundException
instantiate
in interface MBeanServer
ReflectionException
MBeanException
InstanceNotFoundException
public final boolean isInstanceOf(ObjectName objectName, String str) throws InstanceNotFoundException
isInstanceOf
in interface MBeanServer
isInstanceOf
in interface MBeanServerConnection
InstanceNotFoundException
public final Set queryNames(ObjectName objectName, QueryExp queryExp)
queryNames
in interface MBeanServer
queryNames
in interface MBeanServerConnection
public final void removeNotificationListener(ObjectName objectName, ObjectName objectName1) throws InstanceNotFoundException, ListenerNotFoundException
removeNotificationListener
in interface MBeanServer
removeNotificationListener
in interface MBeanServerConnection
InstanceNotFoundException
ListenerNotFoundException
public final void removeNotificationListener(ObjectName objectName, NotificationListener notificationListener) throws InstanceNotFoundException, ListenerNotFoundException
removeNotificationListener
in interface MBeanServer
removeNotificationListener
in interface MBeanServerConnection
InstanceNotFoundException
ListenerNotFoundException
public final void removeNotificationListener(ObjectName objectName, NotificationListener notificationListener, NotificationFilter notificationFilter, Object obj) throws InstanceNotFoundException, ListenerNotFoundException
removeNotificationListener
in interface MBeanServer
removeNotificationListener
in interface MBeanServerConnection
InstanceNotFoundException
ListenerNotFoundException
public final void removeNotificationListener(ObjectName objectName, ObjectName objectName1, NotificationFilter notificationFilter, Object obj) throws InstanceNotFoundException, ListenerNotFoundException
removeNotificationListener
in interface MBeanServer
removeNotificationListener
in interface MBeanServerConnection
InstanceNotFoundException
ListenerNotFoundException
public final ClassLoader getClassLoader(ObjectName objectName) throws InstanceNotFoundException
getClassLoader
in interface MBeanServer
InstanceNotFoundException
public final ClassLoader getClassLoaderFor(ObjectName objectName) throws InstanceNotFoundException
getClassLoaderFor
in interface MBeanServer
InstanceNotFoundException
public final ClassLoaderRepository getClassLoaderRepository()
getClassLoaderRepository
in interface MBeanServer
public final String[] getDomains()
getDomains
in interface MBeanServer
getDomains
in interface MBeanServerConnection
Copyright © 2021. All rights reserved.