|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.jdmk.MBeanServerForwarder
public class MBeanServerForwarder
An object of this class implements the MBeanServer interface and wraps another object that also implements that interface. Every method in MBeanServer is forwarded to the wrapped object.
This class is principally useful as the superclass for other wrapping classes that intercept some of the methods in MBeanServer and perform some action before forwarding to the wrapped object (or do not forward at all).
The wrapped object can be changed at any time. A frequent operation is to insert another MBeanServerForwarder between this one and the wrapped object. The idiom for that is:
synchronized (mbeanServerForwarder) { MBeanServer oldmbs = mbeanServerForwarder.getMBeanServer(); MBeanServer newmbs = new MyMBeanServerForwarder(oldmbs); mbeanServerForwarder.setMBeanServer(newmbs); }
The synchronized
block ensures that information is not
lost if two threads try to insert MBeanServerForwarders at the same time.
Constructor Summary | |
---|---|
MBeanServerForwarder(MBeanServer mbs)
Make a new MBeanServerForwarder that forwards all requests from the MBeanServer interface to mbs . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MBeanServerForwarder(MBeanServer mbs)
mbs
.
mbs
- the wrapped MBeanServer to forward to.Method Detail |
---|
public MBeanServer getMBeanServer()
public void setMBeanServer(MBeanServer mbs) throws IllegalArgumentException
Change the wrapped MBeanServer object to which all requests from the MBeanServer interface are forwarded. The old wrapped object is lost unless it was accessible by other means.
mbs
- the new wrapped object.
IllegalArgumentException
- if mbs
is null.public Object instantiate(String className) throws ReflectionException, MBeanException
instantiate
in interface MBeanServer
ReflectionException
MBeanException
public Object instantiate(String className, ObjectName loaderName) throws ReflectionException, MBeanException, InstanceNotFoundException
instantiate
in interface MBeanServer
ReflectionException
MBeanException
InstanceNotFoundException
public Object instantiate(String className, Object[] params, String[] signature) throws ReflectionException, MBeanException
instantiate
in interface MBeanServer
ReflectionException
MBeanException
public Object instantiate(String className, ObjectName loaderName, Object[] params, String[] signature) throws ReflectionException, MBeanException, InstanceNotFoundException
instantiate
in interface MBeanServer
ReflectionException
MBeanException
InstanceNotFoundException
public ObjectInstance createMBean(String className, ObjectName name) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException
createMBean
in interface MBeanServer
createMBean
in interface MBeanServerConnection
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
public ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException
createMBean
in interface MBeanServer
createMBean
in interface MBeanServerConnection
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
InstanceNotFoundException
public ObjectInstance createMBean(String className, ObjectName name, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException
createMBean
in interface MBeanServer
createMBean
in interface MBeanServerConnection
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
public ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException
createMBean
in interface MBeanServer
createMBean
in interface MBeanServerConnection
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
InstanceNotFoundException
public ObjectInstance registerMBean(Object object, ObjectName name) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException
registerMBean
in interface MBeanServer
InstanceAlreadyExistsException
MBeanRegistrationException
NotCompliantMBeanException
public void unregisterMBean(ObjectName name) throws InstanceNotFoundException, MBeanRegistrationException
unregisterMBean
in interface MBeanServer
unregisterMBean
in interface MBeanServerConnection
InstanceNotFoundException
MBeanRegistrationException
public ObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException
getObjectInstance
in interface MBeanServer
getObjectInstance
in interface MBeanServerConnection
InstanceNotFoundException
public Set queryMBeans(ObjectName name, QueryExp query)
queryMBeans
in interface MBeanServer
queryMBeans
in interface MBeanServerConnection
public Set queryNames(ObjectName name, QueryExp query)
queryNames
in interface MBeanServer
queryNames
in interface MBeanServerConnection
public boolean isRegistered(ObjectName name)
isRegistered
in interface MBeanServer
isRegistered
in interface MBeanServerConnection
public Integer getMBeanCount()
getMBeanCount
in interface MBeanServer
getMBeanCount
in interface MBeanServerConnection
public Object getAttribute(ObjectName name, String attribute) throws MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException
getAttribute
in interface MBeanServer
getAttribute
in interface MBeanServerConnection
MBeanException
AttributeNotFoundException
InstanceNotFoundException
ReflectionException
public AttributeList getAttributes(ObjectName name, String[] attributes) throws InstanceNotFoundException, ReflectionException
getAttributes
in interface MBeanServer
getAttributes
in interface MBeanServerConnection
InstanceNotFoundException
ReflectionException
public void setAttribute(ObjectName name, Attribute attribute) throws InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException
setAttribute
in interface MBeanServer
setAttribute
in interface MBeanServerConnection
InstanceNotFoundException
AttributeNotFoundException
InvalidAttributeValueException
MBeanException
ReflectionException
public AttributeList setAttributes(ObjectName name, AttributeList attributes) throws InstanceNotFoundException, ReflectionException
setAttributes
in interface MBeanServer
setAttributes
in interface MBeanServerConnection
InstanceNotFoundException
ReflectionException
public Object invoke(ObjectName name, String operationName, Object[] params, String[] signature) throws InstanceNotFoundException, MBeanException, ReflectionException
invoke
in interface MBeanServer
invoke
in interface MBeanServerConnection
InstanceNotFoundException
MBeanException
ReflectionException
public String getDefaultDomain()
getDefaultDomain
in interface MBeanServer
getDefaultDomain
in interface MBeanServerConnection
public String[] getDomains()
getDomains
in interface MBeanServer
getDomains
in interface MBeanServerConnection
public void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException
addNotificationListener
in interface MBeanServer
addNotificationListener
in interface MBeanServerConnection
InstanceNotFoundException
public void addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException
addNotificationListener
in interface MBeanServer
addNotificationListener
in interface MBeanServerConnection
InstanceNotFoundException
public void removeNotificationListener(ObjectName name, NotificationListener listener) throws InstanceNotFoundException, ListenerNotFoundException
removeNotificationListener
in interface MBeanServer
removeNotificationListener
in interface MBeanServerConnection
InstanceNotFoundException
ListenerNotFoundException
public void removeNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, ListenerNotFoundException
removeNotificationListener
in interface MBeanServer
removeNotificationListener
in interface MBeanServerConnection
InstanceNotFoundException
ListenerNotFoundException
public void removeNotificationListener(ObjectName name, ObjectName listener) throws InstanceNotFoundException, ListenerNotFoundException
removeNotificationListener
in interface MBeanServer
removeNotificationListener
in interface MBeanServerConnection
InstanceNotFoundException
ListenerNotFoundException
public void removeNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, ListenerNotFoundException
removeNotificationListener
in interface MBeanServer
removeNotificationListener
in interface MBeanServerConnection
InstanceNotFoundException
ListenerNotFoundException
public MBeanInfo getMBeanInfo(ObjectName name) throws InstanceNotFoundException, IntrospectionException, ReflectionException
getMBeanInfo
in interface MBeanServer
getMBeanInfo
in interface MBeanServerConnection
InstanceNotFoundException
IntrospectionException
ReflectionException
public boolean isInstanceOf(ObjectName name, String className) throws InstanceNotFoundException
isInstanceOf
in interface MBeanServer
isInstanceOf
in interface MBeanServerConnection
InstanceNotFoundException
public ObjectInputStream deserialize(ObjectName name, byte[] data) throws InstanceNotFoundException, OperationsException
deserialize
in interface MBeanServer
InstanceNotFoundException
OperationsException
public ObjectInputStream deserialize(String className, byte[] data) throws OperationsException, ReflectionException
deserialize
in interface MBeanServer
OperationsException
ReflectionException
public ObjectInputStream deserialize(String className, ObjectName loaderName, byte[] data) throws InstanceNotFoundException, OperationsException, ReflectionException
deserialize
in interface MBeanServer
InstanceNotFoundException
OperationsException
ReflectionException
public ClassLoader getClassLoaderFor(ObjectName mbeanName) throws InstanceNotFoundException
getClassLoaderFor
in interface MBeanServer
InstanceNotFoundException
public ClassLoader getClassLoader(ObjectName loaderName) throws InstanceNotFoundException
getClassLoader
in interface MBeanServer
InstanceNotFoundException
public ClassLoaderRepository getClassLoaderRepository()
getClassLoaderRepository
in interface MBeanServer
|
Open Source build 02 opendmk-1.0-b02 2007.10.01_19:17:46_MEST |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |