com.sun.jdmk
Class MBeanServerChecker

java.lang.Object
  extended by com.sun.jdmk.MBeanServerForwarder
      extended by com.sun.jdmk.MBeanServerChecker
All Implemented Interfaces:
javax.management.MBeanServer, javax.management.MBeanServerConnection

public abstract class MBeanServerChecker
extends MBeanServerForwarder

An object of this class implements the MBeanServer interface and, for each of its methods, calls an appropriate checking method and then forwards the request to a wrapped MBeanServer object. The checking method may throw a RuntimeException if the operation is not allowed; in this case the request is not forwarded to the wrapped object.

A typical use of this class is to insert it between a connector server such as the HTTP connector and the MBeanServer with which the connector is associated. Requests from the connector client can then be filtered and those operations that are not allowed, or not allowed in a particular context, can be rejected by throwing a SecurityException in the corresponding check* method.

A checking method can obtain the OperationContext associated with the request being handled, if there is one, by calling getOperationContext().

This is an abstract class, because in its implementation none of the checking methods does anything. To be useful, it must be subclassed and at least one of the checking methods overridden to do some checking. Some or all of the MBeanServer methods may also be overridden, for instance if the default checking behavior is inappropriate.

In effect, three levels of checking are possible:

The documentation of the individual check* methods describes what the value of the methodName parameter may be. Future versions of this class may extend these possible values to allow for new methods in the MBeanServer interface.


Constructor Summary
protected MBeanServerChecker(javax.management.MBeanServer mbs)
          Make a new MBeanServerChecker that forwards each method from the MBeanServer interface to the given object, after calling an appropriate checking method.
 
Method Summary
 void addNotificationListener(javax.management.ObjectName name, javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)
          Call checkAny("addNotificationListener", name), then checkNotification("addNotificationListener", name), then forward this method to the wrapped object.
 void addNotificationListener(javax.management.ObjectName name, javax.management.ObjectName listener, javax.management.NotificationFilter filter, java.lang.Object handback)
          Call checkAny("addNotificationListener", name), then checkNotification("addNotificationListener", name), then forward this method to the wrapped object.
protected  void checkAny(java.lang.String methodName, javax.management.ObjectName objectName)
          Checking operation invoked by every method from the MBeanServer interface.
protected  void checkCreate(java.lang.String methodName, java.lang.String className, javax.management.ObjectName objectName, javax.management.ObjectName loaderName, java.lang.Object[] params, java.lang.String[] signature)
          Checking operation invoked by each of the overloaded forms of createMBean and by registerMBean.
protected  void checkDelete(java.lang.String methodName, javax.management.ObjectName objectName)
          Checking operation invoked by unregisterMBean.
protected  void checkDeserialize(java.lang.String methodName, java.lang.Object objectNameOrClass)
          Checking operation invoked by each of the overloaded forms of deserialize.
protected  void checkInstantiate(java.lang.String methodName, java.lang.String className, javax.management.ObjectName loaderName, java.lang.Object[] params, java.lang.String[] signature)
          Checking operation invoked by each of the overloaded forms of instantiate.
protected  void checkInvoke(java.lang.String methodName, javax.management.ObjectName objectName, java.lang.String operationName, java.lang.Object[] params, java.lang.String[] signature)
          Checking operation invoked by invoke.
protected  void checkNotification(java.lang.String methodName, javax.management.ObjectName objectName)
          Checking operation invoked by each of the overloaded forms of addNotificationListener and removeNotificationListener.
protected  void checkQuery(java.lang.String methodName, javax.management.ObjectName name, javax.management.QueryExp query)
          Checking operation invoked by queryMBeans and queryNames.
protected  void checkRead(java.lang.String methodName, javax.management.ObjectName objectName)
          Checking operation invoked by getAttribute, getAttributes, getObjectInstance, isRegistered, getMBeanCount, getDefaultDomain, getMBeanInfo, and isInstanceOf.
protected  void checkWrite(java.lang.String methodName, javax.management.ObjectName objectName)
          Checking operation invoked by setAttribute and setAttributes.
 javax.management.ObjectInstance createMBean(java.lang.String className, javax.management.ObjectName name, java.lang.Object[] params, java.lang.String[] signature)
          Call checkAny("createMBean", name), then checkCreate("createMBean", className, name, null, params, signature), then forward this method to the wrapped object.
 javax.management.ObjectInstance createMBean(java.lang.String className, javax.management.ObjectName name, javax.management.ObjectName loaderName, java.lang.Object[] params, java.lang.String[] signature)
          Call checkAny("createMBean", name), then checkCreate("createMBean", className, name, loaderName, params, signature), then forward this method to the wrapped object.
 java.io.ObjectInputStream deserialize(javax.management.ObjectName name, byte[] data)
          Call checkAny("deserialize", name), then checkDeserialize("deserialize", name), then forward this method to the wrapped object.
 java.io.ObjectInputStream deserialize(java.lang.String className, byte[] data)
          Call checkAny("deserialize", null), then checkDeserialize("deserialize", className), then forward this method to the wrapped object.
 java.io.ObjectInputStream deserialize(java.lang.String className, javax.management.ObjectName loaderName, byte[] data)
          Call checkAny("deserialize", null), then checkDeserialize("deserialize", className), then forward this method to the wrapped object.
 java.lang.Object getAttribute(javax.management.ObjectName name, java.lang.String attribute)
          Call checkAny("getAttribute"), then checkRead("getAttribute", name), then forward this method to the wrapped object.
 javax.management.AttributeList getAttributes(javax.management.ObjectName name, java.lang.String[] attributes)
          Call checkAny("getAttributes", name), then checkRead("getAttributes", name), then forward this method to the wrapped object.
 java.lang.ClassLoader getClassLoader(javax.management.ObjectName loaderName)
          Call checkAny("getClassLoader", loaderName), then checkRead("getClassLoader", loaderName), then forward this method to the wrapped object.
 java.lang.ClassLoader getClassLoaderFor(javax.management.ObjectName mbeanName)
          Call checkAny("getClassLoaderFor", mbeanName), then checkRead("getClassLoaderFor", mbeanName), then forward this method to the wrapped object.
 javax.management.loading.ClassLoaderRepository getClassLoaderRepository()
          Call checkAny("getClassLoaderRepository", null), then checkRead("getClassLoaderRepository", null), then forward this method to the wrapped object.
 java.lang.String getDefaultDomain()
          Call checkAny("getDefaultDomain", null), then checkRead("getDefaultDomain", null), then forward this method to the wrapped object.
 java.lang.String[] getDomains()
          Call checkAny("getDomains", null), then checkRead("getDomains", null), then forward this method to the wrapped object.
 java.lang.Integer getMBeanCount()
          Call checkAny("getMBeanCount", null), then checkRead("getMBeanCount", null), then forward this method to the wrapped object.
 javax.management.MBeanInfo getMBeanInfo(javax.management.ObjectName name)
          Call checkAny("getMBeanInfo", name), then checkRead("getMBeanInfo", name), then forward this method to the wrapped object.
 javax.management.ObjectInstance getObjectInstance(javax.management.ObjectName name)
          Call checkAny("getObjectInstance", name), then checkRead("getObjectInstance", name), then forward this method to the wrapped object.
protected  OperationContext getOperationContext()
          Return the OperationContext associated with the request being handled.
 java.lang.Object instantiate(java.lang.String className, java.lang.Object[] params, java.lang.String[] signature)
          Call checkAny("instantiate", null), then checkInstantiate("instantiate", className, null, params, signature), then forward this method to the wrapped object.
 java.lang.Object instantiate(java.lang.String className, javax.management.ObjectName loaderName, java.lang.Object[] params, java.lang.String[] signature)
          Call checkAny("instantiate", null), then checkInstantiate("instantiate", className, loaderName, params, signature), then forward this method to the wrapped object.
 java.lang.Object invoke(javax.management.ObjectName name, java.lang.String operationName, java.lang.Object[] params, java.lang.String[] signature)
          Call checkAny("invoke", name), then checkInvoke("invoke", name, operationName, params, signature), then forward this method to the wrapped object.
 boolean isInstanceOf(javax.management.ObjectName name, java.lang.String className)
          Call checkAny("isInstanceOf", name), then checkRead("isInstanceOf", name), then forward this method to the wrapped object.
 boolean isRegistered(javax.management.ObjectName name)
          Call checkAny("isRegistered", name), then checkRead("isRegistered", name), then forward this method to the wrapped object.
 java.util.Set queryMBeans(javax.management.ObjectName name, javax.management.QueryExp query)
          Call checkAny("queryMBeans", name), then checkQuery("queryMBeans", name, query), then forward this method to the wrapped object.
 java.util.Set queryNames(javax.management.ObjectName name, javax.management.QueryExp query)
          Call checkAny("queryNames", name), then checkQuery("queryNames", name, query), then forward this method to the wrapped object.
 javax.management.ObjectInstance registerMBean(java.lang.Object object, javax.management.ObjectName name)
          Call checkAny("registerMBean", name), then checkCreate("registerMBean", object.getClass().getName(), name, null, null, null), then forward this method to the wrapped object.
 void removeNotificationListener(javax.management.ObjectName name, javax.management.NotificationListener listener)
          Call checkAny("removeNotificationListener", name), then checkNotification("removeNotificationListener", name), then forward this method to the wrapped object.
 void removeNotificationListener(javax.management.ObjectName name, javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)
          Call checkAny("removeNotificationListener", name), then checkNotification("removeNotificationListener", name), then forward this method to the wrapped object.
 void removeNotificationListener(javax.management.ObjectName name, javax.management.ObjectName listener)
          Call checkAny("removeNotificationListener", name), then checkNotification("removeNotificationListener", name), then forward this method to the wrapped object.
 void removeNotificationListener(javax.management.ObjectName name, javax.management.ObjectName listener, javax.management.NotificationFilter filter, java.lang.Object handback)
          Call checkAny("removeNotificationListener", name), then checkNotification("removeNotificationListener", name), then forward this method to the wrapped object.
 void setAttribute(javax.management.ObjectName name, javax.management.Attribute attribute)
          Call checkAny("setAttribute", name), then checkWrite("setAttribute", name), then forward this method to the wrapped object.
 javax.management.AttributeList setAttributes(javax.management.ObjectName name, javax.management.AttributeList attributes)
          Call checkAny("setAttributes", name), then checkWrite("setAttributes", name), then forward this method to the wrapped object.
 void unregisterMBean(javax.management.ObjectName name)
          Call checkAny("unregisterMBean", name), then checkDelete("unregisterMBean", name), then forward this method to the wrapped object.
 
Methods inherited from class com.sun.jdmk.MBeanServerForwarder
createMBean, createMBean, getMBeanServer, instantiate, instantiate, setMBeanServer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MBeanServerChecker

protected MBeanServerChecker(javax.management.MBeanServer mbs)

Make a new MBeanServerChecker that forwards each method from the MBeanServer interface to the given object, after calling an appropriate checking method.

Parameters:
mbs - the object implementing the MBeanServer interface to which methods should be forwarded.
Method Detail

instantiate

public java.lang.Object instantiate(java.lang.String className,
                                    java.lang.Object[] params,
                                    java.lang.String[] signature)
                             throws javax.management.ReflectionException,
                                    javax.management.MBeanException
Call checkAny("instantiate", null), then checkInstantiate("instantiate", className, null, params, signature), then forward this method to the wrapped object.

Specified by:
instantiate in interface javax.management.MBeanServer
Overrides:
instantiate in class MBeanServerForwarder
Throws:
javax.management.ReflectionException
javax.management.MBeanException

instantiate

public java.lang.Object instantiate(java.lang.String className,
                                    javax.management.ObjectName loaderName,
                                    java.lang.Object[] params,
                                    java.lang.String[] signature)
                             throws javax.management.ReflectionException,
                                    javax.management.MBeanException,
                                    javax.management.InstanceNotFoundException
Call checkAny("instantiate", null), then checkInstantiate("instantiate", className, loaderName, params, signature), then forward this method to the wrapped object.

Specified by:
instantiate in interface javax.management.MBeanServer
Overrides:
instantiate in class MBeanServerForwarder
Throws:
javax.management.ReflectionException
javax.management.MBeanException
javax.management.InstanceNotFoundException

createMBean

public javax.management.ObjectInstance createMBean(java.lang.String className,
                                                   javax.management.ObjectName name,
                                                   java.lang.Object[] params,
                                                   java.lang.String[] signature)
                                            throws javax.management.ReflectionException,
                                                   javax.management.InstanceAlreadyExistsException,
                                                   javax.management.MBeanRegistrationException,
                                                   javax.management.MBeanException,
                                                   javax.management.NotCompliantMBeanException
Call checkAny("createMBean", name), then checkCreate("createMBean", className, name, null, params, signature), then forward this method to the wrapped object.

Specified by:
createMBean in interface javax.management.MBeanServer
Specified by:
createMBean in interface javax.management.MBeanServerConnection
Overrides:
createMBean in class MBeanServerForwarder
Throws:
javax.management.ReflectionException
javax.management.InstanceAlreadyExistsException
javax.management.MBeanRegistrationException
javax.management.MBeanException
javax.management.NotCompliantMBeanException

createMBean

public javax.management.ObjectInstance createMBean(java.lang.String className,
                                                   javax.management.ObjectName name,
                                                   javax.management.ObjectName loaderName,
                                                   java.lang.Object[] params,
                                                   java.lang.String[] signature)
                                            throws javax.management.ReflectionException,
                                                   javax.management.InstanceAlreadyExistsException,
                                                   javax.management.MBeanRegistrationException,
                                                   javax.management.MBeanException,
                                                   javax.management.NotCompliantMBeanException,
                                                   javax.management.InstanceNotFoundException
Call checkAny("createMBean", name), then checkCreate("createMBean", className, name, loaderName, params, signature), then forward this method to the wrapped object.

Specified by:
createMBean in interface javax.management.MBeanServer
Specified by:
createMBean in interface javax.management.MBeanServerConnection
Overrides:
createMBean in class MBeanServerForwarder
Throws:
javax.management.ReflectionException
javax.management.InstanceAlreadyExistsException
javax.management.MBeanRegistrationException
javax.management.MBeanException
javax.management.NotCompliantMBeanException
javax.management.InstanceNotFoundException

registerMBean

public javax.management.ObjectInstance registerMBean(java.lang.Object object,
                                                     javax.management.ObjectName name)
                                              throws javax.management.InstanceAlreadyExistsException,
                                                     javax.management.MBeanRegistrationException,
                                                     javax.management.NotCompliantMBeanException
Call checkAny("registerMBean", name), then checkCreate("registerMBean", object.getClass().getName(), name, null, null, null), then forward this method to the wrapped object.

Specified by:
registerMBean in interface javax.management.MBeanServer
Overrides:
registerMBean in class MBeanServerForwarder
Throws:
javax.management.InstanceAlreadyExistsException
javax.management.MBeanRegistrationException
javax.management.NotCompliantMBeanException

unregisterMBean

public void unregisterMBean(javax.management.ObjectName name)
                     throws javax.management.InstanceNotFoundException,
                            javax.management.MBeanRegistrationException
Call checkAny("unregisterMBean", name), then checkDelete("unregisterMBean", name), then forward this method to the wrapped object.

Specified by:
unregisterMBean in interface javax.management.MBeanServer
Specified by:
unregisterMBean in interface javax.management.MBeanServerConnection
Overrides:
unregisterMBean in class MBeanServerForwarder
Throws:
javax.management.InstanceNotFoundException
javax.management.MBeanRegistrationException

getObjectInstance

public javax.management.ObjectInstance getObjectInstance(javax.management.ObjectName name)
                                                  throws javax.management.InstanceNotFoundException
Call checkAny("getObjectInstance", name), then checkRead("getObjectInstance", name), then forward this method to the wrapped object.

Specified by:
getObjectInstance in interface javax.management.MBeanServer
Specified by:
getObjectInstance in interface javax.management.MBeanServerConnection
Overrides:
getObjectInstance in class MBeanServerForwarder
Throws:
javax.management.InstanceNotFoundException

queryMBeans

public java.util.Set queryMBeans(javax.management.ObjectName name,
                                 javax.management.QueryExp query)
Call checkAny("queryMBeans", name), then checkQuery("queryMBeans", name, query), then forward this method to the wrapped object.

Specified by:
queryMBeans in interface javax.management.MBeanServer
Specified by:
queryMBeans in interface javax.management.MBeanServerConnection
Overrides:
queryMBeans in class MBeanServerForwarder

queryNames

public java.util.Set queryNames(javax.management.ObjectName name,
                                javax.management.QueryExp query)
Call checkAny("queryNames", name), then checkQuery("queryNames", name, query), then forward this method to the wrapped object.

Specified by:
queryNames in interface javax.management.MBeanServer
Specified by:
queryNames in interface javax.management.MBeanServerConnection
Overrides:
queryNames in class MBeanServerForwarder

isRegistered

public boolean isRegistered(javax.management.ObjectName name)
Call checkAny("isRegistered", name), then checkRead("isRegistered", name), then forward this method to the wrapped object.

Specified by:
isRegistered in interface javax.management.MBeanServer
Specified by:
isRegistered in interface javax.management.MBeanServerConnection
Overrides:
isRegistered in class MBeanServerForwarder

getMBeanCount

public java.lang.Integer getMBeanCount()
Call checkAny("getMBeanCount", null), then checkRead("getMBeanCount", null), then forward this method to the wrapped object.

Specified by:
getMBeanCount in interface javax.management.MBeanServer
Specified by:
getMBeanCount in interface javax.management.MBeanServerConnection
Overrides:
getMBeanCount in class MBeanServerForwarder

getAttribute

public java.lang.Object getAttribute(javax.management.ObjectName name,
                                     java.lang.String attribute)
                              throws javax.management.MBeanException,
                                     javax.management.AttributeNotFoundException,
                                     javax.management.InstanceNotFoundException,
                                     javax.management.ReflectionException
Call checkAny("getAttribute"), then checkRead("getAttribute", name), then forward this method to the wrapped object.

Specified by:
getAttribute in interface javax.management.MBeanServer
Specified by:
getAttribute in interface javax.management.MBeanServerConnection
Overrides:
getAttribute in class MBeanServerForwarder
Throws:
javax.management.MBeanException
javax.management.AttributeNotFoundException
javax.management.InstanceNotFoundException
javax.management.ReflectionException

getAttributes

public javax.management.AttributeList getAttributes(javax.management.ObjectName name,
                                                    java.lang.String[] attributes)
                                             throws javax.management.InstanceNotFoundException,
                                                    javax.management.ReflectionException
Call checkAny("getAttributes", name), then checkRead("getAttributes", name), then forward this method to the wrapped object.

Specified by:
getAttributes in interface javax.management.MBeanServer
Specified by:
getAttributes in interface javax.management.MBeanServerConnection
Overrides:
getAttributes in class MBeanServerForwarder
Throws:
javax.management.InstanceNotFoundException
javax.management.ReflectionException

setAttribute

public void setAttribute(javax.management.ObjectName name,
                         javax.management.Attribute attribute)
                  throws javax.management.InstanceNotFoundException,
                         javax.management.AttributeNotFoundException,
                         javax.management.InvalidAttributeValueException,
                         javax.management.MBeanException,
                         javax.management.ReflectionException
Call checkAny("setAttribute", name), then checkWrite("setAttribute", name), then forward this method to the wrapped object.

Specified by:
setAttribute in interface javax.management.MBeanServer
Specified by:
setAttribute in interface javax.management.MBeanServerConnection
Overrides:
setAttribute in class MBeanServerForwarder
Throws:
javax.management.InstanceNotFoundException
javax.management.AttributeNotFoundException
javax.management.InvalidAttributeValueException
javax.management.MBeanException
javax.management.ReflectionException

setAttributes

public javax.management.AttributeList setAttributes(javax.management.ObjectName name,
                                                    javax.management.AttributeList attributes)
                                             throws javax.management.InstanceNotFoundException,
                                                    javax.management.ReflectionException
Call checkAny("setAttributes", name), then checkWrite("setAttributes", name), then forward this method to the wrapped object.

Specified by:
setAttributes in interface javax.management.MBeanServer
Specified by:
setAttributes in interface javax.management.MBeanServerConnection
Overrides:
setAttributes in class MBeanServerForwarder
Throws:
javax.management.InstanceNotFoundException
javax.management.ReflectionException

invoke

public java.lang.Object invoke(javax.management.ObjectName name,
                               java.lang.String operationName,
                               java.lang.Object[] params,
                               java.lang.String[] signature)
                        throws javax.management.InstanceNotFoundException,
                               javax.management.MBeanException,
                               javax.management.ReflectionException
Call checkAny("invoke", name), then checkInvoke("invoke", name, operationName, params, signature), then forward this method to the wrapped object.

Specified by:
invoke in interface javax.management.MBeanServer
Specified by:
invoke in interface javax.management.MBeanServerConnection
Overrides:
invoke in class MBeanServerForwarder
Throws:
javax.management.InstanceNotFoundException
javax.management.MBeanException
javax.management.ReflectionException

getDefaultDomain

public java.lang.String getDefaultDomain()
Call checkAny("getDefaultDomain", null), then checkRead("getDefaultDomain", null), then forward this method to the wrapped object.

Specified by:
getDefaultDomain in interface javax.management.MBeanServer
Specified by:
getDefaultDomain in interface javax.management.MBeanServerConnection
Overrides:
getDefaultDomain in class MBeanServerForwarder

getDomains

public java.lang.String[] getDomains()
Call checkAny("getDomains", null), then checkRead("getDomains", null), then forward this method to the wrapped object.

Specified by:
getDomains in interface javax.management.MBeanServer
Specified by:
getDomains in interface javax.management.MBeanServerConnection
Overrides:
getDomains in class MBeanServerForwarder

addNotificationListener

public void addNotificationListener(javax.management.ObjectName name,
                                    javax.management.NotificationListener listener,
                                    javax.management.NotificationFilter filter,
                                    java.lang.Object handback)
                             throws javax.management.InstanceNotFoundException
Call checkAny("addNotificationListener", name), then checkNotification("addNotificationListener", name), then forward this method to the wrapped object.

Specified by:
addNotificationListener in interface javax.management.MBeanServer
Specified by:
addNotificationListener in interface javax.management.MBeanServerConnection
Overrides:
addNotificationListener in class MBeanServerForwarder
Throws:
javax.management.InstanceNotFoundException

addNotificationListener

public void addNotificationListener(javax.management.ObjectName name,
                                    javax.management.ObjectName listener,
                                    javax.management.NotificationFilter filter,
                                    java.lang.Object handback)
                             throws javax.management.InstanceNotFoundException
Call checkAny("addNotificationListener", name), then checkNotification("addNotificationListener", name), then forward this method to the wrapped object.

Specified by:
addNotificationListener in interface javax.management.MBeanServer
Specified by:
addNotificationListener in interface javax.management.MBeanServerConnection
Overrides:
addNotificationListener in class MBeanServerForwarder
Throws:
javax.management.InstanceNotFoundException

removeNotificationListener

public void removeNotificationListener(javax.management.ObjectName name,
                                       javax.management.NotificationListener listener)
                                throws javax.management.InstanceNotFoundException,
                                       javax.management.ListenerNotFoundException
Call checkAny("removeNotificationListener", name), then checkNotification("removeNotificationListener", name), then forward this method to the wrapped object.

Specified by:
removeNotificationListener in interface javax.management.MBeanServer
Specified by:
removeNotificationListener in interface javax.management.MBeanServerConnection
Overrides:
removeNotificationListener in class MBeanServerForwarder
Throws:
javax.management.InstanceNotFoundException
javax.management.ListenerNotFoundException

removeNotificationListener

public void removeNotificationListener(javax.management.ObjectName name,
                                       javax.management.NotificationListener listener,
                                       javax.management.NotificationFilter filter,
                                       java.lang.Object handback)
                                throws javax.management.InstanceNotFoundException,
                                       javax.management.ListenerNotFoundException
Call checkAny("removeNotificationListener", name), then checkNotification("removeNotificationListener", name), then forward this method to the wrapped object.

Specified by:
removeNotificationListener in interface javax.management.MBeanServer
Specified by:
removeNotificationListener in interface javax.management.MBeanServerConnection
Overrides:
removeNotificationListener in class MBeanServerForwarder
Throws:
javax.management.InstanceNotFoundException
javax.management.ListenerNotFoundException

removeNotificationListener

public void removeNotificationListener(javax.management.ObjectName name,
                                       javax.management.ObjectName listener)
                                throws javax.management.InstanceNotFoundException,
                                       javax.management.ListenerNotFoundException
Call checkAny("removeNotificationListener", name), then checkNotification("removeNotificationListener", name), then forward this method to the wrapped object.

Specified by:
removeNotificationListener in interface javax.management.MBeanServer
Specified by:
removeNotificationListener in interface javax.management.MBeanServerConnection
Overrides:
removeNotificationListener in class MBeanServerForwarder
Throws:
javax.management.InstanceNotFoundException
javax.management.ListenerNotFoundException

removeNotificationListener

public void removeNotificationListener(javax.management.ObjectName name,
                                       javax.management.ObjectName listener,
                                       javax.management.NotificationFilter filter,
                                       java.lang.Object handback)
                                throws javax.management.InstanceNotFoundException,
                                       javax.management.ListenerNotFoundException
Call checkAny("removeNotificationListener", name), then checkNotification("removeNotificationListener", name), then forward this method to the wrapped object.

Specified by:
removeNotificationListener in interface javax.management.MBeanServer
Specified by:
removeNotificationListener in interface javax.management.MBeanServerConnection
Overrides:
removeNotificationListener in class MBeanServerForwarder
Throws:
javax.management.InstanceNotFoundException
javax.management.ListenerNotFoundException

getMBeanInfo

public javax.management.MBeanInfo getMBeanInfo(javax.management.ObjectName name)
                                        throws javax.management.InstanceNotFoundException,
                                               javax.management.IntrospectionException,
                                               javax.management.ReflectionException
Call checkAny("getMBeanInfo", name), then checkRead("getMBeanInfo", name), then forward this method to the wrapped object.

Specified by:
getMBeanInfo in interface javax.management.MBeanServer
Specified by:
getMBeanInfo in interface javax.management.MBeanServerConnection
Overrides:
getMBeanInfo in class MBeanServerForwarder
Throws:
javax.management.InstanceNotFoundException
javax.management.IntrospectionException
javax.management.ReflectionException

isInstanceOf

public boolean isInstanceOf(javax.management.ObjectName name,
                            java.lang.String className)
                     throws javax.management.InstanceNotFoundException
Call checkAny("isInstanceOf", name), then checkRead("isInstanceOf", name), then forward this method to the wrapped object.

Specified by:
isInstanceOf in interface javax.management.MBeanServer
Specified by:
isInstanceOf in interface javax.management.MBeanServerConnection
Overrides:
isInstanceOf in class MBeanServerForwarder
Throws:
javax.management.InstanceNotFoundException

deserialize

public java.io.ObjectInputStream deserialize(javax.management.ObjectName name,
                                             byte[] data)
                                      throws javax.management.InstanceNotFoundException,
                                             javax.management.OperationsException
Call checkAny("deserialize", name), then checkDeserialize("deserialize", name), then forward this method to the wrapped object.

Specified by:
deserialize in interface javax.management.MBeanServer
Overrides:
deserialize in class MBeanServerForwarder
Throws:
javax.management.InstanceNotFoundException
javax.management.OperationsException

deserialize

public java.io.ObjectInputStream deserialize(java.lang.String className,
                                             byte[] data)
                                      throws javax.management.OperationsException,
                                             javax.management.ReflectionException
Call checkAny("deserialize", null), then checkDeserialize("deserialize", className), then forward this method to the wrapped object.

Specified by:
deserialize in interface javax.management.MBeanServer
Overrides:
deserialize in class MBeanServerForwarder
Throws:
javax.management.OperationsException
javax.management.ReflectionException

deserialize

public java.io.ObjectInputStream deserialize(java.lang.String className,
                                             javax.management.ObjectName loaderName,
                                             byte[] data)
                                      throws javax.management.InstanceNotFoundException,
                                             javax.management.OperationsException,
                                             javax.management.ReflectionException
Call checkAny("deserialize", null), then checkDeserialize("deserialize", className), then forward this method to the wrapped object.

Specified by:
deserialize in interface javax.management.MBeanServer
Overrides:
deserialize in class MBeanServerForwarder
Throws:
javax.management.InstanceNotFoundException
javax.management.OperationsException
javax.management.ReflectionException

getClassLoaderFor

public java.lang.ClassLoader getClassLoaderFor(javax.management.ObjectName mbeanName)
                                        throws javax.management.InstanceNotFoundException
Call checkAny("getClassLoaderFor", mbeanName), then checkRead("getClassLoaderFor", mbeanName), then forward this method to the wrapped object.

Specified by:
getClassLoaderFor in interface javax.management.MBeanServer
Overrides:
getClassLoaderFor in class MBeanServerForwarder
Throws:
javax.management.InstanceNotFoundException

getClassLoader

public java.lang.ClassLoader getClassLoader(javax.management.ObjectName loaderName)
                                     throws javax.management.InstanceNotFoundException
Call checkAny("getClassLoader", loaderName), then checkRead("getClassLoader", loaderName), then forward this method to the wrapped object.

Specified by:
getClassLoader in interface javax.management.MBeanServer
Overrides:
getClassLoader in class MBeanServerForwarder
Throws:
javax.management.InstanceNotFoundException

getClassLoaderRepository

public javax.management.loading.ClassLoaderRepository getClassLoaderRepository()
Call checkAny("getClassLoaderRepository", null), then checkRead("getClassLoaderRepository", null), then forward this method to the wrapped object.

Specified by:
getClassLoaderRepository in interface javax.management.MBeanServer
Overrides:
getClassLoaderRepository in class MBeanServerForwarder

getOperationContext

protected OperationContext getOperationContext()
                                        throws java.lang.ClassCastException

Return the OperationContext associated with the request being handled.

Returns:
the OperationContext associated with the request being handled, or null if there is none.
Throws:
java.lang.ClassCastException

checkAny

protected void checkAny(java.lang.String methodName,
                        javax.management.ObjectName objectName)

Checking operation invoked by every method from the MBeanServer interface.

The default implementation does nothing. A subclass may override this method to throw a RuntimeException (or a subclass of it) if the operation is not to be allowed.

Parameters:
methodName - the calling method in the MBeanServer interface. This string is just the method name, e.g., "createMBean".
objectName - the ObjectName of the MBean referenced by the operation, or null if there is none.

checkCreate

protected void checkCreate(java.lang.String methodName,
                           java.lang.String className,
                           javax.management.ObjectName objectName,
                           javax.management.ObjectName loaderName,
                           java.lang.Object[] params,
                           java.lang.String[] signature)

Checking operation invoked by each of the overloaded forms of createMBean and by registerMBean.

The default implementation does nothing. A subclass may override this method to throw a RuntimeException (or a subclass of it) if the operation is not to be allowed.

Parameters:
methodName - the calling method in the MBeanServer interface. This string is just the method name, "createMBean" or "registerMBean".
className - the className parameter of the createMBean operation.
objectName - the name parameter of the createMBean operation.
loaderName - the loaderName parameter of the createMBean operation, or null for those forms of the operation that do not have one.
params - the params parameter of the createMBean operation, or null for those forms of the operation that do not have one.
signature - the signature parameter of the createMBean operation, or null for those forms of the operation that do not have one.

checkInstantiate

protected void checkInstantiate(java.lang.String methodName,
                                java.lang.String className,
                                javax.management.ObjectName loaderName,
                                java.lang.Object[] params,
                                java.lang.String[] signature)

Checking operation invoked by each of the overloaded forms of instantiate.

The default implementation does nothing. A subclass may override this method to throw a RuntimeException (or a subclass of it) if the operation is not to be allowed.

Parameters:
methodName - the calling method in the MBeanServer interface. This string is just the method name, "instantiate".
className - the className parameter of the instantiate operation.
loaderName - the loaderName parameter of the instantiate operation, or null for those forms of the operation that do not have one.
params - the params parameter of the instantiate operation, or null for those forms of the operation that do not have one.
signature - the signature parameter of the instantiate operation, or null for those forms of the operation that do not have one.

checkDelete

protected void checkDelete(java.lang.String methodName,
                           javax.management.ObjectName objectName)

Checking operation invoked by unregisterMBean.

The default implementation does nothing. A subclass may override this method to throw a RuntimeException (or a subclass of it) if the operation is not to be allowed.

Parameters:
methodName - the calling method in the MBeanServer interface. This string is just the method name, "unregisterMBean".
objectName - the name parameter of the unregisterMBean operation.

checkRead

protected void checkRead(java.lang.String methodName,
                         javax.management.ObjectName objectName)

Checking operation invoked by getAttribute, getAttributes, getObjectInstance, isRegistered, getMBeanCount, getDefaultDomain, getMBeanInfo, and isInstanceOf.

The default implementation does nothing. A subclass may override this method to throw a RuntimeException (or a subclass of it) if the operation is not to be allowed.

Parameters:
methodName - the calling method in the MBeanServer interface. This string is just the method name, e.g., "getAttribute".
objectName - the ObjectName of the object being accessed, for those operations where there is one, or null otherwise.

checkWrite

protected void checkWrite(java.lang.String methodName,
                          javax.management.ObjectName objectName)

Checking operation invoked by setAttribute and setAttributes.

The default implementation does nothing. A subclass may override this method to throw a RuntimeException (or a subclass of it) if the operation is not to be allowed.

Parameters:
methodName - the calling method in the MBeanServer interface. This string is just the method name, e.g., "setAttribute".
objectName - the ObjectName of the object being accessed.

checkQuery

protected void checkQuery(java.lang.String methodName,
                          javax.management.ObjectName name,
                          javax.management.QueryExp query)

Checking operation invoked by queryMBeans and queryNames.

The default implementation does nothing. A subclass may override this method to throw a RuntimeException (or a subclass of it) if the operation is not to be allowed.

Parameters:
methodName - the calling method in the MBeanServer interface. This string is just the method name, e.g., "queryMBeans".
name - the name parameter of the operation.
query - the query parameter of the operation.

checkInvoke

protected void checkInvoke(java.lang.String methodName,
                           javax.management.ObjectName objectName,
                           java.lang.String operationName,
                           java.lang.Object[] params,
                           java.lang.String[] signature)

Checking operation invoked by invoke.

The default implementation does nothing. A subclass may override this method to throw a RuntimeException (or a subclass of it) if the operation is not to be allowed.

Parameters:
methodName - the calling method in the MBeanServer interface. This string is just the method name, "invoke".
objectName - the name parameter of the invoke operation.
operationName - the operationName parameter of the invoke operation.
params - the params parameter of the invoke operation.
signature - the signature parameter of the invoke operation.

checkNotification

protected void checkNotification(java.lang.String methodName,
                                 javax.management.ObjectName objectName)

Checking operation invoked by each of the overloaded forms of addNotificationListener and removeNotificationListener.

The default implementation does nothing. A subclass may override this method to throw a RuntimeException (or a subclass of it) if the operation is not to be allowed.

Parameters:
methodName - the calling method in the MBeanServer interface. This string is just the method name, e.g., "addNotificationListener".
objectName - the name parameter of the operation.

checkDeserialize

protected void checkDeserialize(java.lang.String methodName,
                                java.lang.Object objectNameOrClass)

Checking operation invoked by each of the overloaded forms of deserialize.

The default implementation does nothing. A subclass may override this method to throw a RuntimeException (or a subclass of it) if the operation is not to be allowed.

Parameters:
methodName - the calling method in the MBeanServer interface. This string is just the method name, "deserialize".
objectNameOrClass - a String for those forms of the deserialize operation that have a className parameter, or an ObjectName for those forms that do not.

Open Source build 01-ea
opendmk-1.0-b01-ea 2010.09.25_15:22:04_BST

Copyright 1998-2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.