com.sun.jdmk.interceptor
Interface MBeanServerInterceptor

All Superinterfaces:
MBeanInterceptor, NotificationRegistration, ProxyHandler
All Known Subinterfaces:
MBeanServerInt
All Known Implementing Classes:
CompatibleMBeanInterceptor, DefaultMBeanInterceptor, DefaultMBeanServerInterceptor, ForwardingMBeanServerInterceptor, MBeanInterceptorWrapper, MBeanServerImpl, MBeanServerInterceptorWrapper

public interface MBeanServerInterceptor
extends MBeanInterceptor

This interface specifies the behavior to be implemented by an MBean Server Interceptor. An MBean Server Interceptor has essentially the same interface as an MBean Server. An MBean Server forwards received requests to its default interceptor, which may handle them itself or forward them to other interceptors. The default interceptor may be changed via the JdmkMBeanServer.setMBeanServerInterceptor(com.sun.jdmk.interceptor.MBeanServerInterceptor) method.

The initial default interceptor provides the standard MBean Server behavior. It handles a collection of named MBeans, each represented by a Java object. A replacement default interceptor may build on this behavior, for instance by adding logging or security checks, before forwarding requests to the initial default interceptor. Or, it may route each request to one of a number of sub-interceptors, for instance based on the ObjectName in the request.

An interceptor, default or not, need not implement MBeans as Java objects, in the way that the initial default interceptor does. It may instead implement virtual MBeans, which do not exist as Java objects when they are not in use. For example, these MBeans could be implemented by forwarding requests to a database, or to a remote MBean server, or by performing system calls to query or modify system resources.

Note: This interface extends the MBeanInterceptor interface for backward compatibility with the Java DMK 5.0. In next releases, the methods defined in MBeanInterceptor may be moved to this interface and the inheritance link broken.

Since:
Java DMK 5.1

Method Summary
 ClassLoader getClassLoader(ObjectName loaderName)
          Return the named ClassLoader.
 ClassLoader getClassLoaderFor(ObjectName mbeanName)
          Return the ClassLoader that was used for loading the class of the named MBean.
 String[] getDomains()
          Returns the list of domains in which any MBean is currently registered.
 ClassLoader getMBeanClassLoader(ObjectName mbeanName)
          Deprecated. Use getClassLoaderFor(javax.management.ObjectName)
 void removeNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback)
          Removes a listener from a registered MBean.
 void removeNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback)
          Removes a listener from a registered MBean.
 
Methods inherited from interface com.sun.jdmk.MBeanInterceptor
addNotificationListener, addNotificationListener, createMBean, createMBean, getAttribute, getAttributes, getDefaultDomain, getMBeanCount, getMBeanInfo, getObjectInstance, invoke, isInstanceOf, isRegistered, queryMBeans, queryNames, registerMBean, removeNotificationListener, removeNotificationListener, setAttribute, setAttributes, unregisterMBean
 

Method Detail

removeNotificationListener

void removeNotificationListener(ObjectName name,
                                ObjectName listener,
                                NotificationFilter filter,
                                Object handback)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException

Removes a listener from a registered MBean.

The MBean must have a listener that exactly matches the given listener, filter, and handback parameters. If there is more than one such listener, only one is removed.

The filter and handback parameters may be null if and only if they are null in a listener to be removed.

Parameters:
name - The name of the MBean on which the listener should be removed.
listener - A listener that was previously added to this MBean.
filter - The filter that was specified when the listener was added.
handback - The handback that was specified when the listener was added.
Throws:
InstanceNotFoundException - The MBean name provided does not match any of the registered MBeans.
ListenerNotFoundException - The listener is not registered in the MBean, or it is not registered with the given filter and handback.

removeNotificationListener

void removeNotificationListener(ObjectName name,
                                NotificationListener listener,
                                NotificationFilter filter,
                                Object handback)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException

Removes a listener from a registered MBean.

The MBean must have a listener that exactly matches the given listener, filter, and handback parameters. If there is more than one such listener, only one is removed.

The filter and handback parameters may be null if and only if they are null in a listener to be removed.

Parameters:
name - The name of the MBean on which the listener should be removed.
listener - A listener that was previously added to this MBean.
filter - The filter that was specified when the listener was added.
handback - The handback that was specified when the listener was added.
Throws:
InstanceNotFoundException - The MBean name provided does not match any of the registered MBeans.
ListenerNotFoundException - The listener is not registered in the MBean, or it is not registered with the given filter and handback.

getClassLoaderFor

ClassLoader getClassLoaderFor(ObjectName mbeanName)
                              throws InstanceNotFoundException

Return the ClassLoader that was used for loading the class of the named MBean.

Parameters:
mbeanName - The ObjectName of the MBean.
Returns:
The ClassLoader used for that MBean.
Throws:
InstanceNotFoundException - if the named MBean is not found.

getClassLoader

ClassLoader getClassLoader(ObjectName loaderName)
                           throws InstanceNotFoundException

Return the named ClassLoader.

Parameters:
loaderName - The ObjectName of the ClassLoader.
Returns:
The named ClassLoader.
Throws:
InstanceNotFoundException - if the named ClassLoader is not found.

getDomains

String[] getDomains()
Returns the list of domains in which any MBean is currently registered.


getMBeanClassLoader

ClassLoader getMBeanClassLoader(ObjectName mbeanName)
                                throws InstanceNotFoundException
Deprecated. Use getClassLoaderFor(javax.management.ObjectName)

Return the ClassLoader that was used for loading the class of the named MBean.

Specified by:
getMBeanClassLoader in interface MBeanInterceptor
Parameters:
mbeanName - The ObjectName of the MBean.
Returns:
The ClassLoader used for that MBean.
Throws:
InstanceNotFoundException - if the named MBean is not found.
Since:
Java DMK 5.0 (deprecated in Java DMK 5.1)

Open Source build 02
opendmk-1.0-b02 2007.10.01_19:17:46_MEST

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