|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.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 MBeanServeraddNotificationListener in interface MBeanServerConnectionInstanceNotFoundException
public void addNotificationListener(ObjectName name,
ObjectName listener,
NotificationFilter filter,
Object handback)
throws InstanceNotFoundException
addNotificationListener in interface MBeanServeraddNotificationListener in interface MBeanServerConnectionInstanceNotFoundException
public ObjectInstance createMBean(String className,
ObjectName name)
throws ReflectionException,
InstanceAlreadyExistsException,
MBeanRegistrationException,
MBeanException,
NotCompliantMBeanException
createMBean in interface MBeanServercreateMBean in interface MBeanServerConnectionReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
public ObjectInstance createMBean(String className,
ObjectName name,
Object[] params,
String[] signature)
throws ReflectionException,
InstanceAlreadyExistsException,
MBeanRegistrationException,
MBeanException,
NotCompliantMBeanException
createMBean in interface MBeanServercreateMBean in interface MBeanServerConnectionReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
public ObjectInstance createMBean(String className,
ObjectName name,
ObjectName loaderName)
throws ReflectionException,
InstanceAlreadyExistsException,
MBeanRegistrationException,
MBeanException,
NotCompliantMBeanException,
InstanceNotFoundException
createMBean in interface MBeanServercreateMBean in interface MBeanServerConnectionReflectionException
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 MBeanServercreateMBean in interface MBeanServerConnectionReflectionException
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 MBeanServerInstanceNotFoundException
OperationsException
public ObjectInputStream deserialize(String className,
byte[] data)
throws OperationsException,
ReflectionException
UnsupportedOperationException. This behavior can
be changed by subclasses.
deserialize in interface MBeanServerOperationsException
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 MBeanServerInstanceNotFoundException
OperationsException
ReflectionException
public Object getAttribute(ObjectName name,
String attribute)
throws MBeanException,
AttributeNotFoundException,
InstanceNotFoundException,
ReflectionException
getAttribute in interface MBeanServergetAttribute in interface MBeanServerConnectionMBeanException
AttributeNotFoundException
InstanceNotFoundException
ReflectionException
public AttributeList getAttributes(ObjectName name,
String[] attributes)
throws InstanceNotFoundException,
ReflectionException
getAttributes in interface MBeanServergetAttributes in interface MBeanServerConnectionInstanceNotFoundException
ReflectionException
public ClassLoader getClassLoader(ObjectName loaderName)
throws InstanceNotFoundException
UnsupportedOperationException. This behavior can
be changed by subclasses.
getClassLoader in interface MBeanServerInstanceNotFoundException
public ClassLoader getClassLoaderFor(ObjectName mbeanName)
throws InstanceNotFoundException
UnsupportedOperationException. This behavior can
be changed by subclasses.
getClassLoaderFor in interface MBeanServerInstanceNotFoundExceptionpublic ClassLoaderRepository getClassLoaderRepository()
UnsupportedOperationException. This behavior can
be changed by subclasses.
getClassLoaderRepository in interface MBeanServerpublic String getDefaultDomain()
getDefaultDomain in interface MBeanServergetDefaultDomain in interface MBeanServerConnectionpublic String[] getDomains()
getDomains in interface MBeanServergetDomains in interface MBeanServerConnectionpublic Integer getMBeanCount()
getMBeanCount in interface MBeanServergetMBeanCount in interface MBeanServerConnection
public MBeanInfo getMBeanInfo(ObjectName name)
throws InstanceNotFoundException,
IntrospectionException,
ReflectionException
getMBeanInfo in interface MBeanServergetMBeanInfo in interface MBeanServerConnectionInstanceNotFoundException
IntrospectionException
ReflectionException
public ObjectInstance getObjectInstance(ObjectName name)
throws InstanceNotFoundException
getObjectInstance in interface MBeanServergetObjectInstance in interface MBeanServerConnectionInstanceNotFoundException
public Object instantiate(String className)
throws ReflectionException,
MBeanException
UnsupportedOperationException. This behavior can
be changed by subclasses.
instantiate in interface MBeanServerReflectionException
MBeanException
public Object instantiate(String className,
Object[] params,
String[] signature)
throws ReflectionException,
MBeanException
UnsupportedOperationException. This behavior can
be changed by subclasses.
instantiate in interface MBeanServerReflectionException
MBeanException
public Object instantiate(String className,
ObjectName loaderName)
throws ReflectionException,
MBeanException,
InstanceNotFoundException
UnsupportedOperationException. This behavior can
be changed by subclasses.
instantiate in interface MBeanServerReflectionException
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 MBeanServerReflectionException
MBeanException
InstanceNotFoundException
public Object invoke(ObjectName name,
String operationName,
Object[] params,
String[] signature)
throws InstanceNotFoundException,
MBeanException,
ReflectionException
invoke in interface MBeanServerinvoke in interface MBeanServerConnectionInstanceNotFoundException
MBeanException
ReflectionException
public boolean isInstanceOf(ObjectName name,
String className)
throws InstanceNotFoundException
isInstanceOf in interface MBeanServerisInstanceOf in interface MBeanServerConnectionInstanceNotFoundExceptionpublic boolean isRegistered(ObjectName name)
isRegistered in interface MBeanServerisRegistered in interface MBeanServerConnection
public Set queryMBeans(ObjectName name,
QueryExp query)
queryMBeans in interface MBeanServerqueryMBeans in interface MBeanServerConnection
public Set queryNames(ObjectName name,
QueryExp query)
queryNames in interface MBeanServerqueryNames 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 MBeanServerInstanceAlreadyExistsException
MBeanRegistrationException
NotCompliantMBeanException
public void removeNotificationListener(ObjectName name,
NotificationListener listener)
throws InstanceNotFoundException,
ListenerNotFoundException
removeNotificationListener in interface MBeanServerremoveNotificationListener in interface MBeanServerConnectionInstanceNotFoundException
ListenerNotFoundException
public void removeNotificationListener(ObjectName name,
NotificationListener listener,
NotificationFilter filter,
Object handback)
throws InstanceNotFoundException,
ListenerNotFoundException
removeNotificationListener in interface MBeanServerremoveNotificationListener in interface MBeanServerConnectionInstanceNotFoundException
ListenerNotFoundException
public void removeNotificationListener(ObjectName name,
ObjectName listener)
throws InstanceNotFoundException,
ListenerNotFoundException
removeNotificationListener in interface MBeanServerremoveNotificationListener in interface MBeanServerConnectionInstanceNotFoundException
ListenerNotFoundException
public void removeNotificationListener(ObjectName name,
ObjectName listener,
NotificationFilter filter,
Object handback)
throws InstanceNotFoundException,
ListenerNotFoundException
removeNotificationListener in interface MBeanServerremoveNotificationListener in interface MBeanServerConnectionInstanceNotFoundException
ListenerNotFoundException
public void setAttribute(ObjectName name,
Attribute attribute)
throws InstanceNotFoundException,
AttributeNotFoundException,
InvalidAttributeValueException,
MBeanException,
ReflectionException
setAttribute in interface MBeanServersetAttribute in interface MBeanServerConnectionInstanceNotFoundException
AttributeNotFoundException
InvalidAttributeValueException
MBeanException
ReflectionException
public AttributeList setAttributes(ObjectName name,
AttributeList attributes)
throws InstanceNotFoundException,
ReflectionException
setAttributes in interface MBeanServersetAttributes in interface MBeanServerConnectionInstanceNotFoundException
ReflectionException
public void unregisterMBean(ObjectName name)
throws InstanceNotFoundException,
MBeanRegistrationException
unregisterMBean in interface MBeanServerunregisterMBean in interface MBeanServerConnectionInstanceNotFoundException
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 | |||||||||