org.jboss.mx.server
Class MBeanServerImpl

java.lang.Object
  extended byorg.jboss.mx.server.MBeanServerImpl
All Implemented Interfaces:
MBeanServer (src) , MBeanServerConnection (src) , ModelMBeanConstants (src) , ServerConstants (src) , ServiceConstants (src)

public class MBeanServerImpl
extends java.lang.Object
implements MBeanServer (src) , ServerConstants (src) , ServiceConstants (src) , ModelMBeanConstants (src)

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

See Also:
MBeanServer (src) , RequiredModelMBean (src) , ServerConstants (src) , LoaderRepository (src) , UnifiedLoaderRepository3 (src) , XMBean (src)

Field Summary
protected  MBeanServer (src) outer
          The wrapping MBeanServer
protected  MBeanRegistry (src) registry
          Registry used by this server to map MBean object names to resource references.
 
Fields inherited from interface org.jboss.mx.server.ServerConstants (src)
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 (src)
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 (src)
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(java.lang.String defaultDomain, MBeanServer (src)  outer, MBeanServerDelegate (src)  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 (src)  name, NotificationListener (src)  listener, NotificationFilter (src)  filter, java.lang.Object handback)
          Adds a listener to a registered MBean.
 void addNotificationListener(ObjectName (src)  name, ObjectName (src)  listener, NotificationFilter (src)  filter, java.lang.Object handback)
          Adds a listener to a registered MBean.
 ObjectInstance (src) createMBean(java.lang.String className, ObjectName (src)  name)
          Create an MBean registered using the given object name.
 ObjectInstance (src) createMBean(java.lang.String className, ObjectName (src)  name, java.lang.Object[] params, java.lang.String[] signature)
          Create an MBean registered using the given object name.
 ObjectInstance (src) createMBean(java.lang.String className, ObjectName (src)  name, ObjectName (src)  loaderName)
          Create an MBean registered using the given object name.
 ObjectInstance (src) createMBean(java.lang.String className, ObjectName (src)  name, ObjectName (src)  loaderName, java.lang.Object[] params, java.lang.String[] signature)
          Create an MBean registered using the given object name.
protected  MBeanRegistry (src) createRegistry(java.lang.String defaultDomain)
           
 java.io.ObjectInputStream deserialize(ObjectName (src)  name, byte[] data)
          Deprecated.  
 java.io.ObjectInputStream deserialize(java.lang.String className, byte[] data)
          Deprecated.  
 java.io.ObjectInputStream deserialize(java.lang.String className, ObjectName (src)  loaderName, byte[] data)
          Deprecated.  
 java.lang.Object getAttribute(ObjectName (src)  name, java.lang.String attribute)
          Retrieve a value from an MBean.
 AttributeList (src) getAttributes(ObjectName (src)  name, java.lang.String[] attributes)
          Retrieve a list of values from an MBean.
 java.lang.ClassLoader getClassLoader(ObjectName (src)  name)
          Retrieve the classloader registered as an MBean
 java.lang.ClassLoader getClassLoaderFor(ObjectName (src)  name)
          Retrieve the classloader for an mbean
 ClassLoaderRepository (src) getClassLoaderRepository()
          Retrieve the classloader repository for this mbean server
 java.lang.String getDefaultDomain()
          Retrieve the default domain of the mbeanserver.
 java.lang.String[] getDomains()
          Retrieve the domains of the mbeanserver.
 java.lang.Integer getMBeanCount()
          Retrieve the number of mbeans registered in the server.
 MBeanInfo (src) getMBeanInfo(ObjectName (src)  name)
          Retrieves the jmx metadata for an mbean
 ObjectInstance (src) getObjectInstance(ObjectName (src)  name)
          Retrieve an MBean's registration information.
protected  void handleInstantiateExceptions(java.lang.Throwable t, java.lang.String className)
          Handles errors thrown during class instantiation
 java.lang.Object instantiate(java.lang.String className)
          Instantiates an object using the default loader repository and default no-args constructor.
protected  java.lang.Object instantiate(java.lang.String className, java.lang.ClassLoader cl, java.lang.Object[] params, java.lang.String[] signature)
          Instantiate an object, the passed classloader is set as the thread's context classloader for the duration of this method.
 java.lang.Object instantiate(java.lang.String className, java.lang.Object[] params, java.lang.String[] signature)
          Instantiates an object using the default loader repository and a given constructor.
 java.lang.Object instantiate(java.lang.String className, ObjectName (src)  loaderName)
          Instantiates an object using the given class loader.
 java.lang.Object instantiate(java.lang.String className, ObjectName (src)  loaderName, java.lang.Object[] params, java.lang.String[] signature)
          Instantiates an object using the given class loader.
 java.lang.Object invoke(ObjectName (src)  name, java.lang.String operationName, java.lang.Object[] params, java.lang.String[] signature)
          Invokes an operation on an mbean.
 boolean isInstanceOf(ObjectName (src)  name, java.lang.String className)
          Tests whether an mbean can be cast to the given type
 boolean isRegistered(ObjectName (src)  name)
          Test whether an mbean is registered.
protected  boolean queryMBean(ObjectName (src)  objectName, QueryExp (src)  queryExp)
          Query an MBean against the query
 java.util.Set queryMBeans(ObjectName (src)  name, QueryExp (src)  query)
          Retrieve a set of Object instances
 java.util.Set queryNames(ObjectName (src)  name, QueryExp (src)  query)
          Retrieve a set of Object names
 ObjectInstance (src) registerMBean(java.lang.Object object, ObjectName (src)  name)
          Registers a pre-existing object as an MBean with the MBean server.
protected  ObjectInstance (src) registerMBean(java.lang.Object object, ObjectName (src)  name, java.lang.ClassLoader cl)
          Register an MBean
protected  ObjectInstance (src) registerMBean(java.lang.Object mbean, ObjectName (src)  name, ObjectName (src)  loaderName)
          Register an MBean
 void releaseServer()
           
 void removeNotificationListener(ObjectName (src)  name, NotificationListener (src)  listener)
          Removes a listener from a registered MBean.
 void removeNotificationListener(ObjectName (src)  name, NotificationListener (src)  listener, NotificationFilter (src)  filter, java.lang.Object handback)
          Removes a listener from a registered MBean.
 void removeNotificationListener(ObjectName (src)  name, ObjectName (src)  listener)
          Removes a listener from a registered MBean.
 void removeNotificationListener(ObjectName (src)  name, ObjectName (src)  listener, NotificationFilter (src)  filter, java.lang.Object handback)
          Removes a listener from a registered MBean.
 void setAttribute(ObjectName (src)  name, Attribute (src)  attribute)
          Set a value for an MBean.
 AttributeList (src) setAttributes(ObjectName (src)  name, AttributeList (src)  attributes)
          Set a list of values for an MBean.
 java.lang.String toString()
          Simple toString() revealing default domain
 void unregisterMBean(ObjectName (src)  name)
          Unregisters an mbean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

outer

protected MBeanServer (src)  outer
The wrapping MBeanServer


registry

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

Constructor Detail

MBeanServerImpl

public MBeanServerImpl(java.lang.String defaultDomain,
                       MBeanServer (src)  outer,
                       MBeanServerDelegate (src)  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 java.lang.Object instantiate(java.lang.String className)
                             throws ReflectionException (src) ,
                                    MBeanException (src) 
Description copied from interface: MBeanServer (src)
Instantiates an object using the default loader repository and default no-args constructor.

Specified by:
instantiate in interface MBeanServer (src)
Parameters:
className - Class to instantiate. Must have a public no-args constructor. Cannot contain a null reference.
Returns:
instantiated object
Throws:
ReflectionException (src) - If there was an error while trying to invoke the class's constructor or the given class was not found. This exception wraps the actual exception thrown.
MBeanException (src) - If the object constructor threw a checked exception during the initialization. This exception wraps the actual exception thrown.
See Also:
DefaultLoaderRepository (src)

instantiate

public java.lang.Object instantiate(java.lang.String className,
                                    java.lang.Object[] params,
                                    java.lang.String[] signature)
                             throws ReflectionException (src) ,
                                    MBeanException (src) 
Description copied from interface: MBeanServer (src)
Instantiates an object using the default loader repository and a given constructor. The class being instantiated must contain a constructor that matches the signature given as an argument to this method call.

Specified by:
instantiate in interface MBeanServer (src)
Parameters:
className - class to instantiate
params - argument values for the constructor call
signature - signature of the constructor as fully qualified class names
Returns:
instantiated object
Throws:
ReflectionException (src) - If there was an error while trying to invoke the class's constructor or the given class was not found. This exception wraps the actual exception thrown.
MBeanException (src) - If the object constructor raised a checked exception during the initialization. This exception wraps the actual exception thrown.
See Also:
DefaultLoaderRepository (src)

instantiate

public java.lang.Object instantiate(java.lang.String className,
                                    ObjectName (src)  loaderName)
                             throws ReflectionException (src) ,
                                    MBeanException (src) ,
                                    InstanceNotFoundException (src) 
Description copied from interface: MBeanServer (src)
Instantiates an object using the given class loader. If the loader name contains a null reference, the class loader of the MBean server implementation will be used. The object must have a default, no-args constructor.

Specified by:
instantiate in interface MBeanServer (src)
Parameters:
className - Class to instantiate. Must have a public no args constructor. Cannot contain a null reference.
loaderName - Object name of a class loader that has been registered to the server. If null, the class loader of the MBean server is used.
Returns:
instantiated object
Throws:
InstanceNotFoundException (src) - if the specified class loader was not registered to the agent
ReflectionException (src) - If there was an error while trying to invoke the class's constructor or the given class was not found. This exception wraps the actual exception thrown.
MBeanException (src) - If the object constructor threw a checked exception during the initialization. This exception wraps the actual exception thrown.

instantiate

public java.lang.Object instantiate(java.lang.String className,
                                    ObjectName (src)  loaderName,
                                    java.lang.Object[] params,
                                    java.lang.String[] signature)
                             throws ReflectionException (src) ,
                                    MBeanException (src) ,
                                    InstanceNotFoundException (src) 
Description copied from interface: MBeanServer (src)
Instantiates an object using the given class loader. If the loader name contains a null reference, the class loader of the MBean server implementation will be used. The object must contain a constructor with a matching signature given as a parameter to this call.

Specified by:
instantiate in interface MBeanServer (src)
Parameters:
className - class to instantiate
loaderName - object name of a registered class loader in the agent.
params - argument values for the constructor call
signature - signature of the constructor as fully qualified class name strings
Returns:
instantiated object
Throws:
MBeanException (src) - If the object constructor raised a checked exception during the initialization. This exception wraps the actual exception thrown.
ReflectionException (src) - If there was an error while trying to invoke the class's constructor or the given class was not found. this exception wraps the actual exception thrown.
InstanceNotFoundException (src) - if the specified class loader was not registered to the agent.

createMBean

public ObjectInstance (src)  createMBean(java.lang.String className,
                                  ObjectName (src)  name)
                           throws ReflectionException (src) ,
                                  InstanceAlreadyExistsException (src) ,
                                  MBeanRegistrationException (src) ,
                                  MBeanException (src) ,
                                  NotCompliantMBeanException (src) 
Description copied from interface: MBeanServer (src)
Create an MBean registered using the given object name.

Uses the default contructor.

Specified by:
createMBean in interface MBeanServer (src)
Parameters:
className - the class name of the mbean
name - the object name for registration, can be null
Returns:
an ObjectInstance describing the registration
Throws:
NotCompliantMBeanException (src) - if the class name does not correspond to a valid MBean
ReflectionException (src) - for class not found or an exception invoking the contructor
MBeanException (src) - for any exception thrown by the MBean's constructor
InstanceAlreadyExistsException (src) - for an MBean already registered with the passed or generated ObjectName
MBeanRegistrationException (src) - for any exception thrown by the MBean's preRegister

createMBean

public ObjectInstance (src)  createMBean(java.lang.String className,
                                  ObjectName (src)  name,
                                  java.lang.Object[] params,
                                  java.lang.String[] signature)
                           throws ReflectionException (src) ,
                                  InstanceAlreadyExistsException (src) ,
                                  MBeanRegistrationException (src) ,
                                  MBeanException (src) ,
                                  NotCompliantMBeanException (src) 
Description copied from interface: MBeanServer (src)
Create an MBean registered using the given object name.

Uses the specified constructor.

Specified by:
createMBean in interface MBeanServer (src)
Parameters:
className - the class name of the mbean
params - the parameters for the constructor
signature - the signature of the constructor
Returns:
an ObjectInstance describing the registration
Throws:
ReflectionException (src) - for class not found or an exception invoking the contructor
MBeanException (src) - for any exception thrown by the MBean's constructor
MBeanRegistrationException (src) - for any exception thrown by the MBean's preRegister
InstanceAlreadyExistsException (src) - for an MBean already registered with the passed or generated ObjectName
NotCompliantMBeanException (src) - if the class name does not correspond to a valid MBean

createMBean

public ObjectInstance (src)  createMBean(java.lang.String className,
                                  ObjectName (src)  name,
                                  ObjectName (src)  loaderName)
                           throws ReflectionException (src) ,
                                  InstanceAlreadyExistsException (src) ,
                                  MBeanRegistrationException (src) ,
                                  MBeanException (src) ,
                                  NotCompliantMBeanException (src) ,
                                  InstanceNotFoundException (src) 
Description copied from interface: MBeanServer (src)
Create an MBean registered using the given object name.

The MBean is loaded using the passed classloader. Uses the default contructor.

Specified by:
createMBean in interface MBeanServer (src)
Parameters:
className - the class name of the mbean
loaderName - an MBean that implements a classloader
name - the object name for registration, can be null
Returns:
an ObjectInstance describing the registration
Throws:
InstanceNotFoundException (src) - if the loaderName is not a classloader registered in the MBeanServer
MBeanException (src) - for any exception thrown by the MBean's constructor
ReflectionException (src) - for class not found or an exception invoking the contructor
MBeanRegistrationException (src) - for any exception thrown by the MBean's preRegister
NotCompliantMBeanException (src) - if the class name does not correspond to a valid MBean
InstanceAlreadyExistsException (src) - for an MBean already registered with the passed or generated ObjectName

createMBean

public ObjectInstance (src)  createMBean(java.lang.String className,
                                  ObjectName (src)  name,
                                  ObjectName (src)  loaderName,
                                  java.lang.Object[] params,
                                  java.lang.String[] signature)
                           throws ReflectionException (src) ,
                                  InstanceAlreadyExistsException (src) ,
                                  MBeanRegistrationException (src) ,
                                  MBeanException (src) ,
                                  NotCompliantMBeanException (src) ,
                                  InstanceNotFoundException (src) 
Description copied from interface: MBeanServer (src)
Create an MBean registered using the given object name.

The MBean is loaded using the passed classloader. Uses the specified constructor.

Specified by:
createMBean in interface MBeanServer (src)
Parameters:
className - the class name of the mbean
loaderName - an MBean that implements a classloader
name - the object name for registration, can be null
params - the parameters for the constructor
signature - the signature of the constructor
Returns:
an ObjectInstance describing the registration
Throws:
MBeanRegistrationException (src) - for any exception thrown by the MBean's preRegister
MBeanException (src) - for any exception thrown by the MBean's constructor
InstanceNotFoundException (src) - if the loaderName is not a classloader registered in the MBeanServer
NotCompliantMBeanException (src) - if the class name does not correspond to a valid MBean
ReflectionException (src) - for class not found or an exception invoking the contructor
InstanceAlreadyExistsException (src) - for an MBean already registered with the passed or generated ObjectName

registerMBean

public ObjectInstance (src)  registerMBean(java.lang.Object object,
                                    ObjectName (src)  name)
                             throws InstanceAlreadyExistsException (src) ,
                                    MBeanRegistrationException (src) ,
                                    NotCompliantMBeanException (src) 
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 (src)
Parameters:
object - the mbean implementation to register
name - the object name of the mbean to register
Throws:
NotCompliantMBeanException (src) - if the class name does not correspond to a valid MBean
MBeanRegistrationException (src) - for any exception thrown by the MBean's preDeregister
InstanceAlreadyExistsException (src) - if the object name is already registered in the MBeanServer

unregisterMBean

public void unregisterMBean(ObjectName (src)  name)
                     throws InstanceNotFoundException (src) ,
                            MBeanRegistrationException (src) 
Description copied from interface: MBeanServer (src)
Unregisters an mbean.

Specified by:
unregisterMBean in interface MBeanServer (src)
Parameters:
name - the object name of the mbean to unregister
Throws:
InstanceNotFoundException (src) - if the mbean is not registered in the MBeanServer
MBeanRegistrationException (src) - for any exception thrown by the MBean's preDeregister

getObjectInstance

public ObjectInstance (src)  getObjectInstance(ObjectName (src)  name)
                                 throws InstanceNotFoundException (src) 
Description copied from interface: MBeanServer (src)
Retrieve an MBean's registration information.

Specified by:
getObjectInstance in interface MBeanServer (src)
Parameters:
name - the object name of the mbean
Throws:
InstanceNotFoundException (src) - if the mbean is not registered in the MBeanServer

queryMBeans

public java.util.Set queryMBeans(ObjectName (src)  name,
                                 QueryExp (src)  query)
Description copied from interface: MBeanServer (src)
Retrieve a set of Object instances

Specified by:
queryMBeans in interface MBeanServer (src)
Parameters:
name - an ObjectName pattern, can be null for all mbeans
query - a query expression to further filter the mbeans, can be null for no query

queryNames

public java.util.Set queryNames(ObjectName (src)  name,
                                QueryExp (src)  query)
Description copied from interface: MBeanServer (src)
Retrieve a set of Object names

Specified by:
queryNames in interface MBeanServer (src)
Parameters:
name - an ObjectName pattern, can be null for all mbeans
query - a query expression to further filter the mbeans, can be null for no query

isRegistered

public boolean isRegistered(ObjectName (src)  name)
Description copied from interface: MBeanServer (src)
Test whether an mbean is registered.

Specified by:
isRegistered in interface MBeanServer (src)
Parameters:
name - the object name of the mbean
Returns:
true when the mbean is registered, false otherwise

getMBeanCount

public java.lang.Integer getMBeanCount()
Description copied from interface: MBeanServer (src)
Retrieve the number of mbeans registered in the server.

Specified by:
getMBeanCount in interface MBeanServer (src)
Returns:
true the number of registered mbeans

getAttribute

public java.lang.Object getAttribute(ObjectName (src)  name,
                                     java.lang.String attribute)
                              throws MBeanException (src) ,
                                     AttributeNotFoundException (src) ,
                                     InstanceNotFoundException (src) ,
                                     ReflectionException (src) 
Description copied from interface: MBeanServer (src)
Retrieve a value from an MBean.

Specified by:
getAttribute in interface MBeanServer (src)
Parameters:
name - the object name of the mbean
attribute - the attribute name of the value to retrieve
Returns:
the value
Throws:
AttributeNotFoundException (src) - if the mbean has no such attribute
ReflectionException (src) - for an exception invoking the mbean
InstanceNotFoundException (src) - if the mbean is not registered
MBeanException (src) - for any exception thrown by the mbean

getAttributes

public AttributeList (src)  getAttributes(ObjectName (src)  name,
                                   java.lang.String[] attributes)
                            throws InstanceNotFoundException (src) ,
                                   ReflectionException (src) 
Description copied from interface: MBeanServer (src)
Retrieve a list of values from an MBean.

Specified by:
getAttributes in interface MBeanServer (src)
Parameters:
name - the object name of the mbean
attributes - the attribute names of the values to retrieve
Returns:
the list of values, attributes with errors are ignored
Throws:
ReflectionException (src) - for an exception invoking the mbean
InstanceNotFoundException (src) - if the mbean is not registered

setAttribute

public void setAttribute(ObjectName (src)  name,
                         Attribute (src)  attribute)
                  throws InstanceNotFoundException (src) ,
                         AttributeNotFoundException (src) ,
                         InvalidAttributeValueException (src) ,
                         MBeanException (src) ,
                         ReflectionException (src) 
Description copied from interface: MBeanServer (src)
Set a value for an MBean.

Specified by:
setAttribute in interface MBeanServer (src)
Parameters:
name - the object name of the mbean
attribute - the attribute name and value to set
Throws:
MBeanException (src) - for any exception thrown by the mbean
InvalidAttributeValueException (src) - if the new value has an incorrect type
InstanceNotFoundException (src) - if the mbean is not registered
ReflectionException (src) - for an exception invoking the mbean
AttributeNotFoundException (src) - if the mbean has no such attribute

setAttributes

public AttributeList (src)  setAttributes(ObjectName (src)  name,
                                   AttributeList (src)  attributes)
                            throws InstanceNotFoundException (src) ,
                                   ReflectionException (src) 
Description copied from interface: MBeanServer (src)
Set a list of values for an MBean.

Specified by:
setAttributes in interface MBeanServer (src)
Parameters:
name - the object name of the mbean
attributes - the attribute names and values to set
Returns:
the list of values, attributes with errors are ignored
Throws:
InstanceNotFoundException (src) - if the mbean is not registered
ReflectionException (src) - for an exception invoking the mbean

invoke

public java.lang.Object invoke(ObjectName (src)  name,
                               java.lang.String operationName,
                               java.lang.Object[] params,
                               java.lang.String[] signature)
                        throws InstanceNotFoundException (src) ,
                               MBeanException (src) ,
                               ReflectionException (src) 
Description copied from interface: MBeanServer (src)
Invokes an operation on an mbean.

Specified by:
invoke in interface MBeanServer (src)
Parameters:
name - the object name of the mbean
operationName - the operation to perform
params - the parameters
signature - the signature of the operation
Returns:
any result of the operation
Throws:
InstanceNotFoundException (src) - if the mbean is not registered
MBeanException (src) - for any exception thrown by the mbean
ReflectionException (src) - for an exception invoking the mbean

getMBeanInfo

public MBeanInfo (src)  getMBeanInfo(ObjectName (src)  name)
                       throws InstanceNotFoundException (src) ,
                              IntrospectionException (src) ,
                              ReflectionException (src) 
Description copied from interface: MBeanServer (src)
Retrieves the jmx metadata for an mbean

Specified by:
getMBeanInfo in interface MBeanServer (src)
Parameters:
name - the name of the mbean
Returns:
the metadata
Throws:
ReflectionException (src) - for any error trying to invoke the operation on the mbean
IntrospectionException (src) - for any error during instrospection
InstanceNotFoundException (src) - if the mbean is not registered

getDefaultDomain

public java.lang.String getDefaultDomain()
Description copied from interface: MBeanServer (src)
Retrieve the default domain of the mbeanserver.

Specified by:
getDefaultDomain in interface MBeanServer (src)
Returns:
the default domain

getDomains

public java.lang.String[] getDomains()
Description copied from interface: MBeanServer (src)
Retrieve the domains of the mbeanserver.

Specified by:
getDomains in interface MBeanServer (src)
Returns:
the domains

addNotificationListener

public void addNotificationListener(ObjectName (src)  name,
                                    NotificationListener (src)  listener,
                                    NotificationFilter (src)  filter,
                                    java.lang.Object handback)
                             throws InstanceNotFoundException (src) 
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 (src)
Parameters:
name - the name of the MBean broadcasting notifications
listener - the listener to add
filter - a filter to preprocess notifications
handback - a object to add to any notifications
Throws:
InstanceNotFoundException (src) - if the broadcaster is not registered

addNotificationListener

public void addNotificationListener(ObjectName (src)  name,
                                    ObjectName (src)  listener,
                                    NotificationFilter (src)  filter,
                                    java.lang.Object handback)
                             throws InstanceNotFoundException (src) 
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 (src)
Parameters:
name - the name of the MBean broadcasting notifications
listener - the object name listener to add
filter - a filter to preprocess notifications
handback - a object to add to any notifications
Throws:
InstanceNotFoundException (src) - if the broadcaster or listener is not registered

removeNotificationListener

public void removeNotificationListener(ObjectName (src)  name,
                                       NotificationListener (src)  listener)
                                throws InstanceNotFoundException (src) ,
                                       ListenerNotFoundException (src) 
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 (src)
Parameters:
name - the name of the MBean broadcasting notifications
listener - the listener to remove
Throws:
InstanceNotFoundException (src) - if the broadcaster is not registered
ListenerNotFoundException (src) - if the listener is not registered against the broadcaster

removeNotificationListener

public void removeNotificationListener(ObjectName (src)  name,
                                       ObjectName (src)  listener)
                                throws InstanceNotFoundException (src) ,
                                       ListenerNotFoundException (src) 
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 (src)
Parameters:
name - the name of the MBean broadcasting notifications
listener - the object name of the listener to remove
Throws:
InstanceNotFoundException (src) - if the broadcaster or listener is not registered
ListenerNotFoundException (src) - if the listener is not registered against the broadcaster

removeNotificationListener

public void removeNotificationListener(ObjectName (src)  name,
                                       NotificationListener (src)  listener,
                                       NotificationFilter (src)  filter,
                                       java.lang.Object handback)
                                throws InstanceNotFoundException (src) ,
                                       ListenerNotFoundException (src) 
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 (src)
Parameters:
name - the name of the MBean broadcasting notifications
listener - the listener to remove
filter - the filter of the listener to remove
Throws:
InstanceNotFoundException (src) - if the broadcaster is not registered
ListenerNotFoundException (src) - if the listener, filter, handback is not registered against the broadcaster

removeNotificationListener

public void removeNotificationListener(ObjectName (src)  name,
                                       ObjectName (src)  listener,
                                       NotificationFilter (src)  filter,
                                       java.lang.Object handback)
                                throws InstanceNotFoundException (src) ,
                                       ListenerNotFoundException (src) 
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 (src)
Parameters:
name - the name of the MBean broadcasting notifications
listener - the object name of listener to remove
filter - the filter of the listener to remove
Throws:
ListenerNotFoundException (src) - if the listener, filter, handback is not registered against the broadcaster
InstanceNotFoundException (src) - if the broadcaster or listener is not registered

isInstanceOf

public boolean isInstanceOf(ObjectName (src)  name,
                            java.lang.String className)
                     throws InstanceNotFoundException (src) 
Description copied from interface: MBeanServer (src)
Tests whether an mbean can be cast to the given type

Specified by:
isInstanceOf in interface MBeanServer (src)
Parameters:
name - the name of the mbean
className - the class name to check
Returns:
true when it is of that type, false otherwise
Throws:
InstanceNotFoundException (src) - if the mbean is not registered

deserialize

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

Specified by:
deserialize in interface MBeanServer (src)
Throws:
InstanceNotFoundException (src)
OperationsException (src)

deserialize

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

Specified by:
deserialize in interface MBeanServer (src)
Throws:
OperationsException (src)
ReflectionException (src)

deserialize

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

Specified by:
deserialize in interface MBeanServer (src)
Throws:
InstanceNotFoundException (src)
OperationsException (src)
ReflectionException (src)

getClassLoaderFor

public java.lang.ClassLoader getClassLoaderFor(ObjectName (src)  name)
                                        throws InstanceNotFoundException (src) 
Description copied from interface: MBeanServer (src)
Retrieve the classloader for an mbean

Specified by:
getClassLoaderFor in interface MBeanServer (src)
Parameters:
name - the object name of the mbean
Returns:
the classloader
Throws:
InstanceNotFoundException (src) - when the mbean is not registered

getClassLoader

public java.lang.ClassLoader getClassLoader(ObjectName (src)  name)
                                     throws InstanceNotFoundException (src) 
Description copied from interface: MBeanServer (src)
Retrieve the classloader registered as an MBean

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

getClassLoaderRepository

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

Specified by:
getClassLoaderRepository in interface MBeanServer (src)
Returns:
the classloader repository

releaseServer

public void releaseServer()

instantiate

protected java.lang.Object instantiate(java.lang.String className,
                                       java.lang.ClassLoader cl,
                                       java.lang.Object[] params,
                                       java.lang.String[] signature)
                                throws ReflectionException (src) ,
                                       MBeanException (src) 
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 (src) - wraps a ClassCastException or any Exception trying to invoke the constructor
MBeanException (src) - wraps any exception thrown by the constructor
RuntimeOperationsException (src) - Wraps an IllegalArgument for a null className

handleInstantiateExceptions

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

Throws:
ReflectionException (src)
MBeanException (src)

registerMBean

protected ObjectInstance (src)  registerMBean(java.lang.Object mbean,
                                       ObjectName (src)  name,
                                       ObjectName (src)  loaderName)
                                throws ReflectionException (src) ,
                                       InstanceAlreadyExistsException (src) ,
                                       MBeanRegistrationException (src) ,
                                       MBeanException (src) ,
                                       NotCompliantMBeanException (src) ,
                                       InstanceNotFoundException (src) 
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 (src) - when already registered
MBeanRegistrationException (src) - when preRegister(MBeanServer, ObjectName) throws an exception
NotCompliantMBeanException (src) - when the object is not an MBean
ReflectionException (src)
MBeanException (src)
InstanceNotFoundException (src)

registerMBean

protected ObjectInstance (src)  registerMBean(java.lang.Object object,
                                       ObjectName (src)  name,
                                       java.lang.ClassLoader cl)
                                throws InstanceAlreadyExistsException (src) ,
                                       MBeanRegistrationException (src) ,
                                       NotCompliantMBeanException (src) 
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 (src) - when already registered
MBeanRegistrationException (src) - when preRegister(MBeanServer, ObjectName) throws an exception
NotCompliantMBeanException (src) - when the object is not an MBean

queryMBean

protected boolean queryMBean(ObjectName (src)  objectName,
                             QueryExp (src)  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 (src)  createRegistry(java.lang.String defaultDomain)

toString

public java.lang.String toString()
Simple toString() revealing default domain