org.jboss.mx.server
Class MBeanServerImpl

java.lang.Object
  extended by org.jboss.mx.server.MBeanServerImpl
All Implemented Interfaces:
MBeanServer, MBeanServerConnection, ModelMBeanConstants, ServerConstants, ServiceConstants

public class MBeanServerImpl
extends Object
implements MBeanServer, ServerConstants, ServiceConstants, ModelMBeanConstants

MBean server implementation. The MBean server behaviour can be configured by setting the following system properties:

The loader repository is used for managing class loaders in the MBean server. The default repository uses the UnifiedLoaderRepository implementation (DEFAULT_LOADER_REPOSITORY_CLASS).

The default registry is (DEFAULT_MBEAN_REGISTRY_CLASS).

The RequiredModelMBean uses XMBean implementation by default (DEFAULT_REQUIRED_MODELMBEAN_CLASS).

Version:
$Revision: 81022 $
Author:
Juha Lindfors., Trevor Squires., Adrian Brock., Thomas Diesler., Scott.Stark@jboss.org
See Also:
MBeanServer, RequiredModelMBean, ServerConstants, LoaderRepository, UnifiedLoaderRepository3, XMBean

Field Summary
protected  MBeanServer outer
          The wrapping MBeanServer
protected  MBeanRegistry registry
          Registry used by this server to map MBean object names to resource references.
 
Fields inherited from interface org.jboss.mx.server.ServerConstants
CLASS_REMOVED, CLASSLOADER, CLASSLOADER_ADDED, CLASSLOADER_REMOVED, DEFAULT_DOMAIN, DEFAULT_LOADER_NAME, DEFAULT_LOADER_REPOSITORY_CLASS, DEFAULT_MBEAN_REGISTRY_CLASS, DEFAULT_MBEAN_SERVER_BUILDER_CLASS, DEFAULT_REQUIRED_MODELMBEAN_CLASS, DEFAULT_SCOPED_REPOSITORY_CLASS, DEFAULT_SCOPED_REPOSITORY_PARSER_CLASS, IMPLEMENTATION_NAME, IMPLEMENTATION_VENDOR, IMPLEMENTATION_VERSION, JMI_DOMAIN, LOADER_REPOSITORY_CLASS_PROPERTY, MBEAN_REGISTRY, MBEAN_REGISTRY_CLASS_PROPERTY, MBEAN_SERVER_BUILDER_CLASS_PROPERTY, MBEAN_SERVER_CONFIGURATION, MBEAN_SERVER_DELEGATE, OPTIMIZE_REFLECTED_DISPATCHER, REQUIRED_MODELMBEAN_CLASS_PROPERTY, SPECIFICATION_NAME, SPECIFICATION_VENDOR, SPECIFICATION_VERSION, UNIFIED_LOADER_REPOSITORY_CLASS
 
Fields inherited from interface org.jboss.mx.service.ServiceConstants
JBOSSMX_DOMAIN, JBOSSMX_XMBEAN_DTD_1_0, JBOSSMX_XMBEAN_DTD_1_1, JBOSSMX_XMBEAN_DTD_1_2, MBEAN_LOADER_DTD_1_0, PERSISTENCE_TIMER, PUBLIC_JBOSSMX_XMBEAN_DTD_1_0, PUBLIC_JBOSSMX_XMBEAN_DTD_1_1, PUBLIC_JBOSSMX_XMBEAN_DTD_1_2
 
Fields inherited from interface org.jboss.mx.modelmbean.ModelMBeanConstants
ACTION, ACTION_INFO, ALL_DESCRIPTORS, ATTRIBUTE_DESCRIPTOR, ATTRIBUTE_VALUE, CACHE_ALWAYS, CACHE_ALWAYS_LIMIT, CACHE_NEVER, CACHE_NEVER_LIMIT, CACHED_VALUE, CLASS, CONSTRUCTOR_DESCRIPTOR, CURRENCY_TIME_LIMIT, DEFAULT, DELEGATING_PM_OPERATION_DEFAULT_VALUE, DELEGATING_PM_OPERATION_DESCRIPTOR, DELEGATING_PM_SERVICE_DEFAULT_VALUE, DELEGATING_PM_SERVICE_DESCRIPTOR, DESCRIPTOR_TYPE, DISPLAY_NAME, EXPORT, GENERIC_MODELMBEAN_NOTIFICATION, GET_METHOD, HIGH_VISIBILITY, INFO, INTERCEPTORS, IS_IS, IS_READABLE, IS_WRITABLE, LAST_RETURNED_TIME_STAMP, LAST_UPDATED_TIME_STAMP, LAST_UPDATED_TIME_STAMP2, LOG, LOG_FILE, LOW_VISIBILITY, MBEAN_DESCRIPTOR, MBEAN_INFO_INJECTION_TYPE, MBEAN_SERVER_INJECTION_TYPE, MESSAGE_ID, MINIMAL_VISIBILITY, NAME, NORMAL_VISIBILITY, NOTIFICATION_DESCRIPTOR, OBJECT_NAME, OBJECT_NAME_INJECTION_TYPE, OBJECT_REF, OPERATION_DESCRIPTOR, PERSIST_INFO, PERSIST_LOCATION, PERSIST_NAME, PERSIST_PERIOD, PERSIST_POLICIES, PERSIST_POLICY, PERSISTENCE_MANAGER, PP_ALWAYS, PP_NEVER, PP_NO_MORE_OFTEN_THAN, PP_ON_TIMER, PP_ON_UPDATE, PRESENTATION_STRING, PROTOCOL_MAP, RESOURCE_CLASS, ROLE, ROLE_CONSTRUCTOR, ROLE_GETTER, ROLE_OPERATION, ROLE_SETTER, SET_METHOD, SEVERITY, SEVERITY_CRITICAL, SEVERITY_MAJOR, SEVERITY_MINOR, SEVERITY_NON_RECOVERABLE, SEVERITY_NORMAL, SEVERITY_UNKNOWN, SEVERITY_WARNING, TARGET_OBJECT, TARGET_TYPE, VISIBILITY
 
Constructor Summary
MBeanServerImpl(String defaultDomain, MBeanServer outer, MBeanServerDelegate delegate)
          Creates an MBean server implementation with a given default domain name and registers the mandatory server delegate MBean to the server (MBEAN_SERVER_DELEGATE).
 
Method Summary
 void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback)
          Adds a listener to a registered MBean.
 void addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback)
          Adds a listener to a registered MBean.
 ObjectInstance createMBean(String className, ObjectName name)
           
 ObjectInstance createMBean(String className, ObjectName name, Object[] params, String[] signature)
           
 ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName)
           
 ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature)
           
protected  MBeanRegistry createRegistry(String defaultDomain)
           
 ObjectInputStream deserialize(ObjectName name, byte[] data)
          Deprecated.  
 ObjectInputStream deserialize(String className, byte[] data)
          Deprecated.  
 ObjectInputStream deserialize(String className, ObjectName loaderName, byte[] data)
          Deprecated.  
 Object getAttribute(ObjectName name, String attribute)
           
 AttributeList getAttributes(ObjectName name, String[] attributes)
           
 ClassLoader getClassLoader(ObjectName name)
           
 ClassLoader getClassLoaderFor(ObjectName name)
           
 ClassLoaderRepository getClassLoaderRepository()
          Retrieve the classloader repository for this mbean server
 String getDefaultDomain()
           
 String[] getDomains()
           
 Integer getMBeanCount()
           
 MBeanInfo getMBeanInfo(ObjectName name)
           
 ObjectInstance getObjectInstance(ObjectName name)
           
protected  void handleInstantiateExceptions(Throwable t, String className)
          Handles errors thrown during class instantiation
 Object instantiate(String className)
           
protected  Object instantiate(String className, ClassLoader cl, Object[] params, String[] signature)
          Instantiate an object, the passed classloader is set as the thread's context classloader for the duration of this method.
 Object instantiate(String className, Object[] params, String[] signature)
           
 Object instantiate(String className, ObjectName loaderName)
           
 Object instantiate(String className, ObjectName loaderName, Object[] params, String[] signature)
           
 Object invoke(ObjectName name, String operationName, Object[] params, String[] signature)
           
 boolean isInstanceOf(ObjectName name, String className)
           
 boolean isRegistered(ObjectName name)
           
protected  boolean queryMBean(ObjectName objectName, QueryExp queryExp)
          Query an MBean against the query
 Set queryMBeans(ObjectName name, QueryExp query)
           
 Set queryNames(ObjectName name, QueryExp query)
           
 ObjectInstance registerMBean(Object object, ObjectName name)
          Registers a pre-existing object as an MBean with the MBean server.
protected  ObjectInstance registerMBean(Object object, ObjectName name, ClassLoader cl)
          Register an MBean
protected  ObjectInstance registerMBean(Object mbean, ObjectName name, ObjectName loaderName)
          Register an MBean
 void releaseServer()
           
 void removeNotificationListener(ObjectName name, NotificationListener listener)
          Removes a listener from a registered MBean.
 void removeNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback)
          Removes a listener from a registered MBean.
 void removeNotificationListener(ObjectName name, ObjectName listener)
          Removes a listener from a registered MBean.
 void removeNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback)
          Removes a listener from a registered MBean.
 void setAttribute(ObjectName name, Attribute attribute)
           
 AttributeList setAttributes(ObjectName name, AttributeList attributes)
           
 String toString()
          Simple toString() revealing default domain
 void unregisterMBean(ObjectName name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

outer

protected MBeanServer outer
The wrapping MBeanServer


registry

protected MBeanRegistry registry
Registry used by this server to map MBean object names to resource references.

Constructor Detail

MBeanServerImpl

public MBeanServerImpl(String defaultDomain,
                       MBeanServer outer,
                       MBeanServerDelegate delegate)
Creates an MBean server implementation with a given default domain name and registers the mandatory server delegate MBean to the server (MBEAN_SERVER_DELEGATE).

Parameters:
defaultDomain - default domain name
outer - the wrapping MBeanServer, passed to MBeans at registration.
delegate - the delegate to use for Notifications.
Method Detail

instantiate

public Object instantiate(String className)
                   throws ReflectionException,
                          MBeanException
Specified by:
instantiate in interface MBeanServer
Throws:
ReflectionException
MBeanException

instantiate

public Object instantiate(String className,
                          Object[] params,
                          String[] signature)
                   throws ReflectionException,
                          MBeanException
Specified by:
instantiate in interface MBeanServer
Throws:
ReflectionException
MBeanException

instantiate

public Object instantiate(String className,
                          ObjectName loaderName)
                   throws ReflectionException,
                          MBeanException,
                          InstanceNotFoundException
Specified by:
instantiate in interface MBeanServer
Throws:
ReflectionException
MBeanException
InstanceNotFoundException

instantiate

public Object instantiate(String className,
                          ObjectName loaderName,
                          Object[] params,
                          String[] signature)
                   throws ReflectionException,
                          MBeanException,
                          InstanceNotFoundException
Specified by:
instantiate in interface MBeanServer
Throws:
ReflectionException
MBeanException
InstanceNotFoundException

createMBean

public ObjectInstance createMBean(String className,
                                  ObjectName name)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException
Specified by:
createMBean in interface MBeanServer
Specified by:
createMBean in interface MBeanServerConnection
Throws:
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException

createMBean

public ObjectInstance createMBean(String className,
                                  ObjectName name,
                                  Object[] params,
                                  String[] signature)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException
Specified by:
createMBean in interface MBeanServer
Specified by:
createMBean in interface MBeanServerConnection
Throws:
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException

createMBean

public ObjectInstance createMBean(String className,
                                  ObjectName name,
                                  ObjectName loaderName)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException,
                                  InstanceNotFoundException
Specified by:
createMBean in interface MBeanServer
Specified by:
createMBean in interface MBeanServerConnection
Throws:
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
InstanceNotFoundException

createMBean

public ObjectInstance createMBean(String className,
                                  ObjectName name,
                                  ObjectName loaderName,
                                  Object[] params,
                                  String[] signature)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException,
                                  InstanceNotFoundException
Specified by:
createMBean in interface MBeanServer
Specified by:
createMBean in interface MBeanServerConnection
Throws:
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
InstanceNotFoundException

registerMBean

public ObjectInstance registerMBean(Object object,
                                    ObjectName name)
                             throws InstanceAlreadyExistsException,
                                    MBeanRegistrationException,
                                    NotCompliantMBeanException
Registers a pre-existing object as an MBean with the MBean server. If the object name given is null, the MBean must provide its own name by implementing the MBeanRegistration interface and returning the name from the preRegister method.

Specified by:
registerMBean in interface MBeanServer
Throws:
InstanceAlreadyExistsException
MBeanRegistrationException
NotCompliantMBeanException

unregisterMBean

public void unregisterMBean(ObjectName name)
                     throws InstanceNotFoundException,
                            MBeanRegistrationException
Specified by:
unregisterMBean in interface MBeanServer
Specified by:
unregisterMBean in interface MBeanServerConnection
Throws:
InstanceNotFoundException
MBeanRegistrationException

getObjectInstance

public ObjectInstance getObjectInstance(ObjectName name)
                                 throws InstanceNotFoundException
Specified by:
getObjectInstance in interface MBeanServer
Specified by:
getObjectInstance in interface MBeanServerConnection
Throws:
InstanceNotFoundException

queryMBeans

public Set queryMBeans(ObjectName name,
                       QueryExp query)
Specified by:
queryMBeans in interface MBeanServer
Specified by:
queryMBeans in interface MBeanServerConnection

queryNames

public Set queryNames(ObjectName name,
                      QueryExp query)
Specified by:
queryNames in interface MBeanServer
Specified by:
queryNames in interface MBeanServerConnection

isRegistered

public boolean isRegistered(ObjectName name)
Specified by:
isRegistered in interface MBeanServer
Specified by:
isRegistered in interface MBeanServerConnection

getMBeanCount

public Integer getMBeanCount()
Specified by:
getMBeanCount in interface MBeanServer
Specified by:
getMBeanCount in interface MBeanServerConnection

getAttribute

public Object getAttribute(ObjectName name,
                           String attribute)
                    throws MBeanException,
                           AttributeNotFoundException,
                           InstanceNotFoundException,
                           ReflectionException
Specified by:
getAttribute in interface MBeanServer
Specified by:
getAttribute in interface MBeanServerConnection
Throws:
MBeanException
AttributeNotFoundException
InstanceNotFoundException
ReflectionException

getAttributes

public AttributeList getAttributes(ObjectName name,
                                   String[] attributes)
                            throws InstanceNotFoundException,
                                   ReflectionException
Specified by:
getAttributes in interface MBeanServer
Specified by:
getAttributes in interface MBeanServerConnection
Throws:
InstanceNotFoundException
ReflectionException

setAttribute

public void setAttribute(ObjectName name,
                         Attribute attribute)
                  throws InstanceNotFoundException,
                         AttributeNotFoundException,
                         InvalidAttributeValueException,
                         MBeanException,
                         ReflectionException
Specified by:
setAttribute in interface MBeanServer
Specified by:
setAttribute in interface MBeanServerConnection
Throws:
InstanceNotFoundException
AttributeNotFoundException
InvalidAttributeValueException
MBeanException
ReflectionException

setAttributes

public AttributeList setAttributes(ObjectName name,
                                   AttributeList attributes)
                            throws InstanceNotFoundException,
                                   ReflectionException
Specified by:
setAttributes in interface MBeanServer
Specified by:
setAttributes in interface MBeanServerConnection
Throws:
InstanceNotFoundException
ReflectionException

invoke

public Object invoke(ObjectName name,
                     String operationName,
                     Object[] params,
                     String[] signature)
              throws InstanceNotFoundException,
                     MBeanException,
                     ReflectionException
Specified by:
invoke in interface MBeanServer
Specified by:
invoke in interface MBeanServerConnection
Throws:
InstanceNotFoundException
MBeanException
ReflectionException

getMBeanInfo

public MBeanInfo getMBeanInfo(ObjectName name)
                       throws InstanceNotFoundException,
                              IntrospectionException,
                              ReflectionException
Specified by:
getMBeanInfo in interface MBeanServer
Specified by:
getMBeanInfo in interface MBeanServerConnection
Throws:
InstanceNotFoundException
IntrospectionException
ReflectionException

getDefaultDomain

public String getDefaultDomain()
Specified by:
getDefaultDomain in interface MBeanServer
Specified by:
getDefaultDomain in interface MBeanServerConnection

getDomains

public String[] getDomains()
Specified by:
getDomains in interface MBeanServer
Specified by:
getDomains in interface MBeanServerConnection

addNotificationListener

public void addNotificationListener(ObjectName name,
                                    NotificationListener listener,
                                    NotificationFilter filter,
                                    Object handback)
                             throws InstanceNotFoundException
Adds a listener to a registered MBean. A notification emitted by the MBean will be forwarded by the MBeanServer to the listener. If the source of the notification is a reference to the MBean object, the MBean server will replace it by the MBean's ObjectName. Otherwise the source is unchanged.

Specified by:
addNotificationListener in interface MBeanServer
Specified by:
addNotificationListener in interface MBeanServerConnection
Throws:
InstanceNotFoundException

addNotificationListener

public void addNotificationListener(ObjectName name,
                                    ObjectName listener,
                                    NotificationFilter filter,
                                    Object handback)
                             throws InstanceNotFoundException
Adds a listener to a registered MBean. A notification emitted by the MBean will be forwarded by the MBeanServer to the listener. If the source of the notification is a reference to the MBean object, the MBean server will replace it by the MBean's ObjectName. Otherwise the source is unchanged. The listener object that receives notifications is the one that is registered with the given name at the time this method is called. Even if it is subsequently unregistered, it will continue to receive notifications.

Specified by:
addNotificationListener in interface MBeanServer
Specified by:
addNotificationListener in interface MBeanServerConnection
Throws:
InstanceNotFoundException

removeNotificationListener

public void removeNotificationListener(ObjectName name,
                                       NotificationListener listener)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException
Removes a listener from a registered MBean. If the listener is registered more than once, perhaps with different filters or callbacks, this method will remove all those registrations.

Specified by:
removeNotificationListener in interface MBeanServer
Specified by:
removeNotificationListener in interface MBeanServerConnection
Throws:
InstanceNotFoundException
ListenerNotFoundException

removeNotificationListener

public void removeNotificationListener(ObjectName name,
                                       ObjectName listener)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException
Removes a listener from a registered MBean. If the listener is registered more than once, perhaps with different filters or callbacks, this method will remove all those registrations.

Specified by:
removeNotificationListener in interface MBeanServer
Specified by:
removeNotificationListener in interface MBeanServerConnection
Throws:
InstanceNotFoundException
ListenerNotFoundException

removeNotificationListener

public 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.

Specified by:
removeNotificationListener in interface MBeanServer
Specified by:
removeNotificationListener in interface MBeanServerConnection
Throws:
InstanceNotFoundException
ListenerNotFoundException

removeNotificationListener

public 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.

Specified by:
removeNotificationListener in interface MBeanServer
Specified by:
removeNotificationListener in interface MBeanServerConnection
Throws:
InstanceNotFoundException
ListenerNotFoundException

isInstanceOf

public boolean isInstanceOf(ObjectName name,
                            String className)
                     throws InstanceNotFoundException
Specified by:
isInstanceOf in interface MBeanServer
Specified by:
isInstanceOf in interface MBeanServerConnection
Throws:
InstanceNotFoundException

deserialize

public ObjectInputStream deserialize(ObjectName name,
                                     byte[] data)
                              throws InstanceNotFoundException,
                                     OperationsException
Deprecated. 

Specified by:
deserialize in interface MBeanServer
Throws:
InstanceNotFoundException
OperationsException

deserialize

public ObjectInputStream deserialize(String className,
                                     byte[] data)
                              throws OperationsException,
                                     ReflectionException
Deprecated. 

Specified by:
deserialize in interface MBeanServer
Throws:
OperationsException
ReflectionException

deserialize

public ObjectInputStream deserialize(String className,
                                     ObjectName loaderName,
                                     byte[] data)
                              throws InstanceNotFoundException,
                                     OperationsException,
                                     ReflectionException
Deprecated. 

Specified by:
deserialize in interface MBeanServer
Throws:
InstanceNotFoundException
OperationsException
ReflectionException

getClassLoaderFor

public ClassLoader getClassLoaderFor(ObjectName name)
                              throws InstanceNotFoundException
Specified by:
getClassLoaderFor in interface MBeanServer
Throws:
InstanceNotFoundException

getClassLoader

public ClassLoader getClassLoader(ObjectName name)
                           throws InstanceNotFoundException
Specified by:
getClassLoader in interface MBeanServer
Parameters:
name - The ObjectName of the ClassLoader. May be null, in which case the MBean server's own ClassLoader is returned.
Returns:
Throws:
InstanceNotFoundException

getClassLoaderRepository

public ClassLoaderRepository getClassLoaderRepository()
Retrieve the classloader repository for this mbean server

Specified by:
getClassLoaderRepository in interface MBeanServer
Returns:
the classloader repository

releaseServer

public void releaseServer()

instantiate

protected Object instantiate(String className,
                             ClassLoader cl,
                             Object[] params,
                             String[] signature)
                      throws ReflectionException,
                             MBeanException
Instantiate an object, the passed classloader is set as the thread's context classloader for the duration of this method.

Parameters:
className - the class name of the object to instantiate
cl - the thread classloader, pass null to use the ClassLoaderRepository
params - the parameters for the constructor
signature - the signature of the constructor
Throws:
ReflectionException - wraps a ClassCastException or any Exception trying to invoke the constructor
MBeanException - wraps any exception thrown by the constructor
RuntimeOperationsException - Wraps an IllegalArgument for a null className

handleInstantiateExceptions

protected void handleInstantiateExceptions(Throwable t,
                                           String className)
                                    throws ReflectionException,
                                           MBeanException
Handles errors thrown during class instantiation

Throws:
ReflectionException
MBeanException

registerMBean

protected ObjectInstance registerMBean(Object mbean,
                                       ObjectName name,
                                       ObjectName loaderName)
                                throws ReflectionException,
                                       InstanceAlreadyExistsException,
                                       MBeanRegistrationException,
                                       MBeanException,
                                       NotCompliantMBeanException,
                                       InstanceNotFoundException
Register an MBean

The classloader is used as the thread context classloader during access to the mbean and it's interceptors

Parameters:
mbean - the mbean to register
name - the object name to register
loaderName - the object name of a class loader also used as as the MBeans TCL
Throws:
InstanceAlreadyExistsException - when already registered
MBeanRegistrationException - when preRegister(MBeanServer, ObjectName) throws an exception
NotCompliantMBeanException - when the object is not an MBean
ReflectionException
MBeanException
InstanceNotFoundException

registerMBean

protected ObjectInstance registerMBean(Object object,
                                       ObjectName name,
                                       ClassLoader cl)
                                throws InstanceAlreadyExistsException,
                                       MBeanRegistrationException,
                                       NotCompliantMBeanException
Register an MBean

The classloader is used as the thread context classloader during access to the mbean and it's interceptors

Parameters:
object - the mbean to register
name - the object name to register
cl - the thread classloader, pass null for the current one
Throws:
InstanceAlreadyExistsException - when already registered
MBeanRegistrationException - when preRegister(MBeanServer, ObjectName) throws an exception
NotCompliantMBeanException - when the object is not an MBean

queryMBean

protected boolean queryMBean(ObjectName objectName,
                             QueryExp queryExp)
Query an MBean against the query

Parameters:
objectName - the object name of the mbean to check
queryExp - the query expression to test
Returns:
true when the query applies to the MBean or the query is null, false otherwise.

createRegistry

protected MBeanRegistry createRegistry(String defaultDomain)

toString

public String toString()
Simple toString() revealing default domain

Overrides:
toString in class Object


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.