|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.jdmk.remote.cascading.MBeanServerConnectionWrapper
public abstract class MBeanServerConnectionWrapper
An object of this class implements the MBeanServer interface
and, for each of its methods forwards the request to a wrapped
MBeanServerConnection
object.
Some methods of the MBeanServer
interface do not have
any equivalent in MBeanServerConnection
. In that case, an
UnsupportedOperationException
will be thrown.
A typical use of this class is to apply a QueryExp object locally,
on an MBean that resides in a remote MBeanServer. Since an
MBeanServerConnection is not an MBeanServer, it cannot be passed
to the setMBeanServer()
method of the QueryExp
object. However, this object can.
This is an abstract class, and although only
getMBeanServerConnection()
is declared abstract, implementing
this single method will usually not be sufficient in order to
substitute an instance of this class to an
MBeanServer in the general case: for instance, the methods like
getClassLoader(javax.management.ObjectName)
, getClassLoaderFor(javax.management.ObjectName)
etc... which
are not part of the MBeanServerConnection
interface will
throw an UnsupportedOperationException
in their
default implementation. Therefore,
it would not be appropriate to pass an instance of this class
to an object that expect these methods to be implemented, unless those
methods have been appropriately implemented in a subclass.
Constructor Summary | |
---|---|
MBeanServerConnectionWrapper()
|
Method Summary | |
---|---|
void |
addNotificationListener(ObjectName name,
NotificationListener listener,
NotificationFilter filter,
Object handback)
Forward this method to the wrapped object. |
void |
addNotificationListener(ObjectName name,
ObjectName listener,
NotificationFilter filter,
Object handback)
Forward this method to the wrapped object. |
ObjectInstance |
createMBean(String className,
ObjectName name)
Forward this method to the wrapped object. |
ObjectInstance |
createMBean(String className,
ObjectName name,
Object[] params,
String[] signature)
Forward this method to the wrapped object. |
ObjectInstance |
createMBean(String className,
ObjectName name,
ObjectName loaderName)
Forward this method to the wrapped object. |
ObjectInstance |
createMBean(String className,
ObjectName name,
ObjectName loaderName,
Object[] params,
String[] signature)
Forward this method to the wrapped object. |
ObjectInputStream |
deserialize(ObjectName name,
byte[] data)
Throws an UnsupportedOperationException . |
ObjectInputStream |
deserialize(String className,
byte[] data)
Throws an UnsupportedOperationException . |
ObjectInputStream |
deserialize(String className,
ObjectName loaderName,
byte[] data)
Throws an UnsupportedOperationException . |
Object |
getAttribute(ObjectName name,
String attribute)
Forward this method to the wrapped object. |
AttributeList |
getAttributes(ObjectName name,
String[] attributes)
Forward this method to the wrapped object. |
ClassLoader |
getClassLoader(ObjectName loaderName)
Throws an UnsupportedOperationException . |
ClassLoader |
getClassLoaderFor(ObjectName mbeanName)
Throws an UnsupportedOperationException . |
ClassLoaderRepository |
getClassLoaderRepository()
Throws an UnsupportedOperationException . |
String |
getDefaultDomain()
Forward this method to the wrapped object. |
String[] |
getDomains()
Forward this method to the wrapped object. |
Integer |
getMBeanCount()
Forward this method to the wrapped object. |
MBeanInfo |
getMBeanInfo(ObjectName name)
Forward this method to the wrapped object. |
protected abstract MBeanServerConnection |
getMBeanServerConnection()
Returns an MBeanServerConnection. |
ObjectInstance |
getObjectInstance(ObjectName name)
Forward this method to the wrapped object. |
protected RuntimeException |
handleIOException(IOException x,
String method)
This method is called each time an IOException is raised when trying to forward an operation to the underlying MBeanServerConnection, as a result of calling getMBeanServerConnection() or as a result of invoking the
operation on the returned connection. |
Object |
instantiate(String className)
Throws an UnsupportedOperationException . |
Object |
instantiate(String className,
Object[] params,
String[] signature)
Throws an UnsupportedOperationException . |
Object |
instantiate(String className,
ObjectName loaderName)
Throws an UnsupportedOperationException . |
Object |
instantiate(String className,
ObjectName loaderName,
Object[] params,
String[] signature)
Throws an UnsupportedOperationException . |
Object |
invoke(ObjectName name,
String operationName,
Object[] params,
String[] signature)
Forward this method to the wrapped object. |
boolean |
isInstanceOf(ObjectName name,
String className)
Forward this method to the wrapped object. |
boolean |
isRegistered(ObjectName name)
Forward this method to the wrapped object. |
Set |
queryMBeans(ObjectName name,
QueryExp query)
Forward this method to the wrapped object. |
Set |
queryNames(ObjectName name,
QueryExp query)
Forward this method to the wrapped object. |
ObjectInstance |
registerMBean(Object object,
ObjectName name)
Throws an UnsupportedOperationException . |
void |
removeNotificationListener(ObjectName name,
NotificationListener listener)
Forward this method to the wrapped object. |
void |
removeNotificationListener(ObjectName name,
NotificationListener listener,
NotificationFilter filter,
Object handback)
Forward this method to the wrapped object. |
void |
removeNotificationListener(ObjectName name,
ObjectName listener)
Forward this method to the wrapped object. |
void |
removeNotificationListener(ObjectName name,
ObjectName listener,
NotificationFilter filter,
Object handback)
Forward this method to the wrapped object. |
void |
setAttribute(ObjectName name,
Attribute attribute)
Forward this method to the wrapped object. |
AttributeList |
setAttributes(ObjectName name,
AttributeList attributes)
Forward this method to the wrapped object. |
void |
unregisterMBean(ObjectName name)
Forward this method to the wrapped object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MBeanServerConnectionWrapper()
Method Detail |
---|
protected abstract MBeanServerConnection getMBeanServerConnection() throws IOException
IOException
protected RuntimeException handleIOException(IOException x, String method)
getMBeanServerConnection()
or as a result of invoking the
operation on the returned connection.
Subclasses may redefine this method if they need to perform any
specific handling of IOException (logging etc...).
x
- The raised IOException.method
- The name of the method in which the exception was
raised. This is one of the methods of the MBeanServer
interface.
UndeclaredThrowableException
wrapping x.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 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, 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) 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, 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 ObjectInputStream deserialize(ObjectName name, byte[] data) throws InstanceNotFoundException, OperationsException
UnsupportedOperationException
. This behavior can
be changed by subclasses.
deserialize
in interface MBeanServer
InstanceNotFoundException
OperationsException
public ObjectInputStream deserialize(String className, byte[] data) throws OperationsException, ReflectionException
UnsupportedOperationException
. This behavior can
be changed by subclasses.
deserialize
in interface MBeanServer
OperationsException
ReflectionException
public ObjectInputStream deserialize(String className, ObjectName loaderName, byte[] data) throws InstanceNotFoundException, OperationsException, ReflectionException
UnsupportedOperationException
. This behavior can
be changed by subclasses.
deserialize
in interface MBeanServer
InstanceNotFoundException
OperationsException
ReflectionException
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 ClassLoader getClassLoader(ObjectName loaderName) throws InstanceNotFoundException
UnsupportedOperationException
. This behavior can
be changed by subclasses.
getClassLoader
in interface MBeanServer
InstanceNotFoundException
public ClassLoader getClassLoaderFor(ObjectName mbeanName) throws InstanceNotFoundException
UnsupportedOperationException
. This behavior can
be changed by subclasses.
getClassLoaderFor
in interface MBeanServer
InstanceNotFoundException
public ClassLoaderRepository getClassLoaderRepository()
UnsupportedOperationException
. This behavior can
be changed by subclasses.
getClassLoaderRepository
in interface MBeanServer
public String getDefaultDomain()
getDefaultDomain
in interface MBeanServer
getDefaultDomain
in interface MBeanServerConnection
public String[] getDomains()
getDomains
in interface MBeanServer
getDomains
in interface MBeanServerConnection
public Integer getMBeanCount()
getMBeanCount
in interface MBeanServer
getMBeanCount
in interface MBeanServerConnection
public MBeanInfo getMBeanInfo(ObjectName name) throws InstanceNotFoundException, IntrospectionException, ReflectionException
getMBeanInfo
in interface MBeanServer
getMBeanInfo
in interface MBeanServerConnection
InstanceNotFoundException
IntrospectionException
ReflectionException
public ObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException
getObjectInstance
in interface MBeanServer
getObjectInstance
in interface MBeanServerConnection
InstanceNotFoundException
public Object instantiate(String className) throws ReflectionException, MBeanException
UnsupportedOperationException
. This behavior can
be changed by subclasses.
instantiate
in interface MBeanServer
ReflectionException
MBeanException
public Object instantiate(String className, Object[] params, String[] signature) throws ReflectionException, MBeanException
UnsupportedOperationException
. This behavior can
be changed by subclasses.
instantiate
in interface MBeanServer
ReflectionException
MBeanException
public Object instantiate(String className, ObjectName loaderName) throws ReflectionException, MBeanException, InstanceNotFoundException
UnsupportedOperationException
. This behavior can
be changed by subclasses.
instantiate
in interface MBeanServer
ReflectionException
MBeanException
InstanceNotFoundException
public Object instantiate(String className, ObjectName loaderName, Object[] params, String[] signature) throws ReflectionException, MBeanException, InstanceNotFoundException
UnsupportedOperationException
. This behavior can
be changed by subclasses.
instantiate
in interface MBeanServer
ReflectionException
MBeanException
InstanceNotFoundException
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 boolean isInstanceOf(ObjectName name, String className) throws InstanceNotFoundException
isInstanceOf
in interface MBeanServer
isInstanceOf
in interface MBeanServerConnection
InstanceNotFoundException
public boolean isRegistered(ObjectName name)
isRegistered
in interface MBeanServer
isRegistered
in interface MBeanServerConnection
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 ObjectInstance registerMBean(Object object, ObjectName name) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException
UnsupportedOperationException
. This behavior can
be changed by subclasses.
registerMBean
in interface MBeanServer
InstanceAlreadyExistsException
MBeanRegistrationException
NotCompliantMBeanException
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 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 void unregisterMBean(ObjectName name) throws InstanceNotFoundException, MBeanRegistrationException
unregisterMBean
in interface MBeanServer
unregisterMBean
in interface MBeanServerConnection
InstanceNotFoundException
MBeanRegistrationException
|
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 |