|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.jdmk.MBeanServerForwarder com.sun.jdmk.MBeanServerChecker
public abstract class MBeanServerChecker
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:
checkAny
so that it applies
some restriction to every operation, or so that it consults the
methodName
parameter to apply restrictions to particular
operations.check*
methods to
apply restrictions to certain classes of methods. Again, the
methodName
parameter is available to refine these
restrictions by applying them only to particular operations.MBeanServer
interface itself. These methods are called with exactly the same
parameters as they will have in the real MBeanServer, so decisions can
be based on complete information. If an operation is accepted, the
overriding method should call super.methodName
to
forward it to the real MBeanServer.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(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(ObjectName name,
NotificationListener listener,
NotificationFilter filter,
Object handback)
Call checkAny("addNotificationListener", name) , then
checkNotification("addNotificationListener", name) ,
then forward this method to the wrapped object. |
void |
addNotificationListener(ObjectName name,
ObjectName listener,
NotificationFilter filter,
Object handback)
Call checkAny("addNotificationListener", name) , then
checkNotification("addNotificationListener", name) ,
then forward this method to the wrapped object. |
protected void |
checkAny(String methodName,
ObjectName objectName)
Checking operation invoked by every method from the MBeanServer interface. |
protected void |
checkCreate(String methodName,
String className,
ObjectName objectName,
ObjectName loaderName,
Object[] params,
String[] signature)
Checking operation invoked by each of the overloaded forms of createMBean and by registerMBean . |
protected void |
checkDelete(String methodName,
ObjectName objectName)
Checking operation invoked by unregisterMBean . |
protected void |
checkDeserialize(String methodName,
Object objectNameOrClass)
Checking operation invoked by each of the overloaded forms of deserialize . |
protected void |
checkInstantiate(String methodName,
String className,
ObjectName loaderName,
Object[] params,
String[] signature)
Checking operation invoked by each of the overloaded forms of instantiate . |
protected void |
checkInvoke(String methodName,
ObjectName objectName,
String operationName,
Object[] params,
String[] signature)
Checking operation invoked by invoke . |
protected void |
checkNotification(String methodName,
ObjectName objectName)
Checking operation invoked by each of the overloaded forms of addNotificationListener and
removeNotificationListener . |
protected void |
checkQuery(String methodName,
ObjectName name,
QueryExp query)
Checking operation invoked by queryMBeans and
queryNames . |
protected void |
checkRead(String methodName,
ObjectName objectName)
Checking operation invoked by getAttribute ,
getAttributes , getObjectInstance ,
isRegistered , getMBeanCount ,
getDefaultDomain , getMBeanInfo , and
isInstanceOf . |
protected void |
checkWrite(String methodName,
ObjectName objectName)
Checking operation invoked by setAttribute and
setAttributes . |
ObjectInstance |
createMBean(String className,
ObjectName name,
Object[] params,
String[] signature)
Call checkAny("createMBean", name) , then
checkCreate("createMBean", className, name, null, params,
signature) , then forward this method to the wrapped object. |
ObjectInstance |
createMBean(String className,
ObjectName name,
ObjectName loaderName,
Object[] params,
String[] signature)
Call checkAny("createMBean", name) , then
checkCreate("createMBean", className, name, loaderName, params,
signature) , then forward this method to the wrapped object. |
ObjectInputStream |
deserialize(ObjectName name,
byte[] data)
Call checkAny("deserialize", name) , then
checkDeserialize("deserialize", name) ,
then forward this method to the wrapped object. |
ObjectInputStream |
deserialize(String className,
byte[] data)
Call checkAny("deserialize", null) , then
checkDeserialize("deserialize", className) ,
then forward this method to the wrapped object. |
ObjectInputStream |
deserialize(String className,
ObjectName loaderName,
byte[] data)
Call checkAny("deserialize", null) , then
checkDeserialize("deserialize", className) ,
then forward this method to the wrapped object. |
Object |
getAttribute(ObjectName name,
String attribute)
Call checkAny("getAttribute") , then
checkRead("getAttribute", name) ,
then forward this method to the wrapped object. |
AttributeList |
getAttributes(ObjectName name,
String[] attributes)
Call checkAny("getAttributes", name) , then
checkRead("getAttributes", name) ,
then forward this method to the wrapped object. |
ClassLoader |
getClassLoader(ObjectName loaderName)
Call checkAny("getClassLoader", loaderName) , then
checkRead("getClassLoader", loaderName) ,
then forward this method to the wrapped object. |
ClassLoader |
getClassLoaderFor(ObjectName mbeanName)
Call checkAny("getClassLoaderFor", mbeanName) , then
checkRead("getClassLoaderFor", mbeanName) ,
then forward this method to the wrapped object. |
ClassLoaderRepository |
getClassLoaderRepository()
Call checkAny("getClassLoaderRepository", null) , then
checkRead("getClassLoaderRepository", null) ,
then forward this method to the wrapped object. |
String |
getDefaultDomain()
Call checkAny("getDefaultDomain", null) , then
checkRead("getDefaultDomain", null) ,
then forward this method to the wrapped object. |
String[] |
getDomains()
Call checkAny("getDomains", null) , then
checkRead("getDomains", null) ,
then forward this method to the wrapped object. |
Integer |
getMBeanCount()
Call checkAny("getMBeanCount", null) , then
checkRead("getMBeanCount", null) ,
then forward this method to the wrapped object. |
MBeanInfo |
getMBeanInfo(ObjectName name)
Call checkAny("getMBeanInfo", name) , then
checkRead("getMBeanInfo", name) ,
then forward this method to the wrapped object. |
ObjectInstance |
getObjectInstance(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. |
Object |
instantiate(String className,
Object[] params,
String[] signature)
Call checkAny("instantiate", null) , then
checkInstantiate("instantiate", className, null, params,
signature) , then forward this method to the wrapped
object. |
Object |
instantiate(String className,
ObjectName loaderName,
Object[] params,
String[] signature)
Call checkAny("instantiate", null) , then
checkInstantiate("instantiate", className, loaderName,
params, signature) , then forward this method to the
wrapped object. |
Object |
invoke(ObjectName name,
String operationName,
Object[] params,
String[] signature)
Call checkAny("invoke", name) , then
checkInvoke("invoke", name, operationName, params,
signature) , then forward this method to the wrapped object. |
boolean |
isInstanceOf(ObjectName name,
String className)
Call checkAny("isInstanceOf", name) , then
checkRead("isInstanceOf", name) ,
then forward this method to the wrapped object. |
boolean |
isRegistered(ObjectName name)
Call checkAny("isRegistered", name) , then
checkRead("isRegistered", name) ,
then forward this method to the wrapped object. |
Set |
queryMBeans(ObjectName name,
QueryExp query)
Call checkAny("queryMBeans", name) , then
checkQuery("queryMBeans", name, query) ,
then forward this method to the wrapped object. |
Set |
queryNames(ObjectName name,
QueryExp query)
Call checkAny("queryNames", name) , then
checkQuery("queryNames", name, query) ,
then forward this method to the wrapped object. |
ObjectInstance |
registerMBean(Object object,
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(ObjectName name,
NotificationListener listener)
Call checkAny("removeNotificationListener", name) , then
checkNotification("removeNotificationListener", name) ,
then forward this method to the wrapped object. |
void |
removeNotificationListener(ObjectName name,
NotificationListener listener,
NotificationFilter filter,
Object handback)
Call checkAny("removeNotificationListener", name) , then
checkNotification("removeNotificationListener", name) ,
then forward this method to the wrapped object. |
void |
removeNotificationListener(ObjectName name,
ObjectName listener)
Call checkAny("removeNotificationListener", name) , then
checkNotification("removeNotificationListener", name) ,
then forward this method to the wrapped object. |
void |
removeNotificationListener(ObjectName name,
ObjectName listener,
NotificationFilter filter,
Object handback)
Call checkAny("removeNotificationListener", name) , then
checkNotification("removeNotificationListener", name) ,
then forward this method to the wrapped object. |
void |
setAttribute(ObjectName name,
Attribute attribute)
Call checkAny("setAttribute", name) , then
checkWrite("setAttribute", name) ,
then forward this method to the wrapped object. |
AttributeList |
setAttributes(ObjectName name,
AttributeList attributes)
Call checkAny("setAttributes", name) , then
checkWrite("setAttributes", name) ,
then forward this method to the wrapped object. |
void |
unregisterMBean(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 |
---|
protected MBeanServerChecker(MBeanServer mbs)
Make a new MBeanServerChecker that forwards each method from the MBeanServer interface to the given object, after calling an appropriate checking method.
mbs
- the object implementing the MBeanServer interface to which
methods should be forwarded.Method Detail |
---|
public Object instantiate(String className, Object[] params, String[] signature) throws ReflectionException, MBeanException
checkAny("instantiate", null)
, then
checkInstantiate("instantiate", className, null, params,
signature)
, then forward this method to the wrapped
object.
instantiate
in interface MBeanServer
instantiate
in class MBeanServerForwarder
ReflectionException
MBeanException
public Object instantiate(String className, ObjectName loaderName, Object[] params, String[] signature) throws ReflectionException, MBeanException, InstanceNotFoundException
checkAny("instantiate", null)
, then
checkInstantiate("instantiate", className, loaderName,
params, signature)
, then forward this method to the
wrapped object.
instantiate
in interface MBeanServer
instantiate
in class MBeanServerForwarder
ReflectionException
MBeanException
InstanceNotFoundException
public ObjectInstance createMBean(String className, ObjectName name, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException
checkAny("createMBean", name)
, then
checkCreate("createMBean", className, name, null, params,
signature)
, then forward this method to the wrapped object.
createMBean
in interface MBeanServer
createMBean
in interface MBeanServerConnection
createMBean
in class MBeanServerForwarder
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
checkAny("createMBean", name)
, then
checkCreate("createMBean", className, name, loaderName, params,
signature)
, then forward this method to the wrapped object.
createMBean
in interface MBeanServer
createMBean
in interface MBeanServerConnection
createMBean
in class MBeanServerForwarder
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
InstanceNotFoundException
public ObjectInstance registerMBean(Object object, ObjectName name) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException
checkAny("registerMBean", name)
, then
checkCreate("registerMBean", object.getClass().getName(), name,
null, null, null)
, then forward this method to the wrapped
object.
registerMBean
in interface MBeanServer
registerMBean
in class MBeanServerForwarder
InstanceAlreadyExistsException
MBeanRegistrationException
NotCompliantMBeanException
public void unregisterMBean(ObjectName name) throws InstanceNotFoundException, MBeanRegistrationException
checkAny("unregisterMBean", name)
, then
checkDelete("unregisterMBean", name)
,
then forward this method to the wrapped object.
unregisterMBean
in interface MBeanServer
unregisterMBean
in interface MBeanServerConnection
unregisterMBean
in class MBeanServerForwarder
InstanceNotFoundException
MBeanRegistrationException
public ObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException
checkAny("getObjectInstance", name)
, then
checkRead("getObjectInstance", name)
,
then forward this method to the wrapped object.
getObjectInstance
in interface MBeanServer
getObjectInstance
in interface MBeanServerConnection
getObjectInstance
in class MBeanServerForwarder
InstanceNotFoundException
public Set queryMBeans(ObjectName name, QueryExp query)
checkAny("queryMBeans", name)
, then
checkQuery("queryMBeans", name, query)
,
then forward this method to the wrapped object.
queryMBeans
in interface MBeanServer
queryMBeans
in interface MBeanServerConnection
queryMBeans
in class MBeanServerForwarder
public Set queryNames(ObjectName name, QueryExp query)
checkAny("queryNames", name)
, then
checkQuery("queryNames", name, query)
,
then forward this method to the wrapped object.
queryNames
in interface MBeanServer
queryNames
in interface MBeanServerConnection
queryNames
in class MBeanServerForwarder
public boolean isRegistered(ObjectName name)
checkAny("isRegistered", name)
, then
checkRead("isRegistered", name)
,
then forward this method to the wrapped object.
isRegistered
in interface MBeanServer
isRegistered
in interface MBeanServerConnection
isRegistered
in class MBeanServerForwarder
public Integer getMBeanCount()
checkAny("getMBeanCount", null)
, then
checkRead("getMBeanCount", null)
,
then forward this method to the wrapped object.
getMBeanCount
in interface MBeanServer
getMBeanCount
in interface MBeanServerConnection
getMBeanCount
in class MBeanServerForwarder
public Object getAttribute(ObjectName name, String attribute) throws MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException
checkAny("getAttribute")
, then
checkRead("getAttribute", name)
,
then forward this method to the wrapped object.
getAttribute
in interface MBeanServer
getAttribute
in interface MBeanServerConnection
getAttribute
in class MBeanServerForwarder
MBeanException
AttributeNotFoundException
InstanceNotFoundException
ReflectionException
public AttributeList getAttributes(ObjectName name, String[] attributes) throws InstanceNotFoundException, ReflectionException
checkAny("getAttributes", name)
, then
checkRead("getAttributes", name)
,
then forward this method to the wrapped object.
getAttributes
in interface MBeanServer
getAttributes
in interface MBeanServerConnection
getAttributes
in class MBeanServerForwarder
InstanceNotFoundException
ReflectionException
public void setAttribute(ObjectName name, Attribute attribute) throws InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException
checkAny("setAttribute", name)
, then
checkWrite("setAttribute", name)
,
then forward this method to the wrapped object.
setAttribute
in interface MBeanServer
setAttribute
in interface MBeanServerConnection
setAttribute
in class MBeanServerForwarder
InstanceNotFoundException
AttributeNotFoundException
InvalidAttributeValueException
MBeanException
ReflectionException
public AttributeList setAttributes(ObjectName name, AttributeList attributes) throws InstanceNotFoundException, ReflectionException
checkAny("setAttributes", name)
, then
checkWrite("setAttributes", name)
,
then forward this method to the wrapped object.
setAttributes
in interface MBeanServer
setAttributes
in interface MBeanServerConnection
setAttributes
in class MBeanServerForwarder
InstanceNotFoundException
ReflectionException
public Object invoke(ObjectName name, String operationName, Object[] params, String[] signature) throws InstanceNotFoundException, MBeanException, ReflectionException
checkAny("invoke", name)
, then
checkInvoke("invoke", name, operationName, params,
signature)
, then forward this method to the wrapped object.
invoke
in interface MBeanServer
invoke
in interface MBeanServerConnection
invoke
in class MBeanServerForwarder
InstanceNotFoundException
MBeanException
ReflectionException
public String getDefaultDomain()
checkAny("getDefaultDomain", null)
, then
checkRead("getDefaultDomain", null)
,
then forward this method to the wrapped object.
getDefaultDomain
in interface MBeanServer
getDefaultDomain
in interface MBeanServerConnection
getDefaultDomain
in class MBeanServerForwarder
public String[] getDomains()
checkAny("getDomains", null)
, then
checkRead("getDomains", null)
,
then forward this method to the wrapped object.
getDomains
in interface MBeanServer
getDomains
in interface MBeanServerConnection
getDomains
in class MBeanServerForwarder
public void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException
checkAny("addNotificationListener", name)
, then
checkNotification("addNotificationListener", name)
,
then forward this method to the wrapped object.
addNotificationListener
in interface MBeanServer
addNotificationListener
in interface MBeanServerConnection
addNotificationListener
in class MBeanServerForwarder
InstanceNotFoundException
public void addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException
checkAny("addNotificationListener", name)
, then
checkNotification("addNotificationListener", name)
,
then forward this method to the wrapped object.
addNotificationListener
in interface MBeanServer
addNotificationListener
in interface MBeanServerConnection
addNotificationListener
in class MBeanServerForwarder
InstanceNotFoundException
public void removeNotificationListener(ObjectName name, NotificationListener listener) throws InstanceNotFoundException, ListenerNotFoundException
checkAny("removeNotificationListener", name)
, then
checkNotification("removeNotificationListener", name)
,
then forward this method to the wrapped object.
removeNotificationListener
in interface MBeanServer
removeNotificationListener
in interface MBeanServerConnection
removeNotificationListener
in class MBeanServerForwarder
InstanceNotFoundException
ListenerNotFoundException
public void removeNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, ListenerNotFoundException
checkAny("removeNotificationListener", name)
, then
checkNotification("removeNotificationListener", name)
,
then forward this method to the wrapped object.
removeNotificationListener
in interface MBeanServer
removeNotificationListener
in interface MBeanServerConnection
removeNotificationListener
in class MBeanServerForwarder
InstanceNotFoundException
ListenerNotFoundException
public void removeNotificationListener(ObjectName name, ObjectName listener) throws InstanceNotFoundException, ListenerNotFoundException
checkAny("removeNotificationListener", name)
, then
checkNotification("removeNotificationListener", name)
,
then forward this method to the wrapped object.
removeNotificationListener
in interface MBeanServer
removeNotificationListener
in interface MBeanServerConnection
removeNotificationListener
in class MBeanServerForwarder
InstanceNotFoundException
ListenerNotFoundException
public void removeNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, ListenerNotFoundException
checkAny("removeNotificationListener", name)
, then
checkNotification("removeNotificationListener", name)
,
then forward this method to the wrapped object.
removeNotificationListener
in interface MBeanServer
removeNotificationListener
in interface MBeanServerConnection
removeNotificationListener
in class MBeanServerForwarder
InstanceNotFoundException
ListenerNotFoundException
public MBeanInfo getMBeanInfo(ObjectName name) throws InstanceNotFoundException, IntrospectionException, ReflectionException
checkAny("getMBeanInfo", name)
, then
checkRead("getMBeanInfo", name)
,
then forward this method to the wrapped object.
getMBeanInfo
in interface MBeanServer
getMBeanInfo
in interface MBeanServerConnection
getMBeanInfo
in class MBeanServerForwarder
InstanceNotFoundException
IntrospectionException
ReflectionException
public boolean isInstanceOf(ObjectName name, String className) throws InstanceNotFoundException
checkAny("isInstanceOf", name)
, then
checkRead("isInstanceOf", name)
,
then forward this method to the wrapped object.
isInstanceOf
in interface MBeanServer
isInstanceOf
in interface MBeanServerConnection
isInstanceOf
in class MBeanServerForwarder
InstanceNotFoundException
public ObjectInputStream deserialize(ObjectName name, byte[] data) throws InstanceNotFoundException, OperationsException
checkAny("deserialize", name)
, then
checkDeserialize("deserialize", name)
,
then forward this method to the wrapped object.
deserialize
in interface MBeanServer
deserialize
in class MBeanServerForwarder
InstanceNotFoundException
OperationsException
public ObjectInputStream deserialize(String className, byte[] data) throws OperationsException, ReflectionException
checkAny("deserialize", null)
, then
checkDeserialize("deserialize", className)
,
then forward this method to the wrapped object.
deserialize
in interface MBeanServer
deserialize
in class MBeanServerForwarder
OperationsException
ReflectionException
public ObjectInputStream deserialize(String className, ObjectName loaderName, byte[] data) throws InstanceNotFoundException, OperationsException, ReflectionException
checkAny("deserialize", null)
, then
checkDeserialize("deserialize", className)
,
then forward this method to the wrapped object.
deserialize
in interface MBeanServer
deserialize
in class MBeanServerForwarder
InstanceNotFoundException
OperationsException
ReflectionException
public ClassLoader getClassLoaderFor(ObjectName mbeanName) throws InstanceNotFoundException
checkAny("getClassLoaderFor", mbeanName)
, then
checkRead("getClassLoaderFor", mbeanName)
,
then forward this method to the wrapped object.
getClassLoaderFor
in interface MBeanServer
getClassLoaderFor
in class MBeanServerForwarder
InstanceNotFoundException
public ClassLoader getClassLoader(ObjectName loaderName) throws InstanceNotFoundException
checkAny("getClassLoader", loaderName)
, then
checkRead("getClassLoader", loaderName)
,
then forward this method to the wrapped object.
getClassLoader
in interface MBeanServer
getClassLoader
in class MBeanServerForwarder
InstanceNotFoundException
public ClassLoaderRepository getClassLoaderRepository()
checkAny("getClassLoaderRepository", null)
, then
checkRead("getClassLoaderRepository", null)
,
then forward this method to the wrapped object.
getClassLoaderRepository
in interface MBeanServer
getClassLoaderRepository
in class MBeanServerForwarder
protected OperationContext getOperationContext() throws ClassCastException
Return the OperationContext
associated with the
request being handled.
OperationContext
associated with the
request being handled, or null if there is none.
ClassCastException
protected void checkAny(String methodName, 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.
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.protected void checkCreate(String methodName, String className, ObjectName objectName, ObjectName loaderName, Object[] params, 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.
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.protected void checkInstantiate(String methodName, String className, ObjectName loaderName, Object[] params, 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.
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.protected void checkDelete(String methodName, 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.
methodName
- the calling method in the MBeanServer
interface. This string is just the method name,
"unregisterMBean
".objectName
- the name
parameter of the
unregisterMBean
operation.protected void checkRead(String methodName, 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.
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.protected void checkWrite(String methodName, 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.
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.protected void checkQuery(String methodName, ObjectName name, 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.
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.protected void checkInvoke(String methodName, ObjectName objectName, String operationName, Object[] params, 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.
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.protected void checkNotification(String methodName, 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.
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.protected void checkDeserialize(String methodName, 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.
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 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 |