|
||||||||||
| PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.mx.server.MBeanServerImpl
MBean server implementation. The MBean server behaviour can be configured by setting the following system properties:
LOADER_REPOSITORY_CLASS_PROPERTY)MBEAN_REGISTRY_CLASS_PROPERTY)REQUIRED_MODELMBEAN_CLASS_PROPERTY)DEFAULT_LOADER_REPOSITORY_CLASS).
The default registry is
(DEFAULT_MBEAN_REGISTRY_CLASS).
The RequiredModelMBean uses XMBean implementation by default
(DEFAULT_REQUIRED_MODELMBEAN_CLASS).
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.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 |
| 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 |
protected MBeanServer (src) outer
protected MBeanRegistry (src) registry
| Constructor Detail |
public MBeanServerImpl(java.lang.String defaultDomain,
MBeanServer (src) outer,
MBeanServerDelegate (src) delegate)
MBEAN_SERVER_DELEGATE).
defaultDomain - default domain nameouter - the wrapping MBeanServer, passed to MBeans
at registration.delegate - the delegate to use
for Notifications.| Method Detail |
public java.lang.Object instantiate(java.lang.String className)
throws ReflectionException (src) ,
MBeanException (src)
MBeanServer (src)
instantiate in interface MBeanServer (src) className - Class to instantiate. Must have a public no-args
constructor. Cannot contain a null reference.
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.DefaultLoaderRepository (src)
public java.lang.Object instantiate(java.lang.String className,
java.lang.Object[] params,
java.lang.String[] signature)
throws ReflectionException (src) ,
MBeanException (src)
MBeanServer (src)
instantiate in interface MBeanServer (src) className - class to instantiateparams - argument values for the constructor callsignature - signature of the constructor as fully qualified class names
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.DefaultLoaderRepository (src)
public java.lang.Object instantiate(java.lang.String className,
ObjectName (src) loaderName)
throws ReflectionException (src) ,
MBeanException (src) ,
InstanceNotFoundException (src)
MBeanServer (src)
instantiate in interface MBeanServer (src) 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.
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.
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)
MBeanServer (src)
instantiate in interface MBeanServer (src) className - class to instantiateloaderName - object name of a registered class loader in the agent.params - argument values for the constructor callsignature - signature of the constructor as fully qualified class name strings
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.
public ObjectInstance (src) createMBean(java.lang.String className,
ObjectName (src) name)
throws ReflectionException (src) ,
InstanceAlreadyExistsException (src) ,
MBeanRegistrationException (src) ,
MBeanException (src) ,
NotCompliantMBeanException (src)
MBeanServer (src) Uses the default contructor.
createMBean in interface MBeanServer (src) className - the class name of the mbeanname - the object name for registration, can be null
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
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)
MBeanServer (src) Uses the specified constructor.
createMBean in interface MBeanServer (src) className - the class name of the mbeanparams - the parameters for the constructorsignature - the signature of the constructor
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
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)
MBeanServer (src) The MBean is loaded using the passed classloader. Uses the default contructor.
createMBean in interface MBeanServer (src) className - the class name of the mbeanloaderName - an MBean that implements a classloadername - the object name for registration, can be null
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
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)
MBeanServer (src) The MBean is loaded using the passed classloader. Uses the specified constructor.
createMBean in interface MBeanServer (src) className - the class name of the mbeanloaderName - an MBean that implements a classloadername - the object name for registration, can be nullparams - the parameters for the constructorsignature - the signature of the constructor
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
public ObjectInstance (src) registerMBean(java.lang.Object object,
ObjectName (src) name)
throws InstanceAlreadyExistsException (src) ,
MBeanRegistrationException (src) ,
NotCompliantMBeanException (src)
registerMBean in interface MBeanServer (src) object - the mbean implementation to registername - the object name of the mbean to register
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
public void unregisterMBean(ObjectName (src) name)
throws InstanceNotFoundException (src) ,
MBeanRegistrationException (src)
MBeanServer (src)
unregisterMBean in interface MBeanServer (src) name - the object name of the mbean to unregister
InstanceNotFoundException (src) - if the mbean is not registered
in the MBeanServer
MBeanRegistrationException (src) - for any exception thrown by the
MBean's preDeregister
public ObjectInstance (src) getObjectInstance(ObjectName (src) name)
throws InstanceNotFoundException (src)
MBeanServer (src)
getObjectInstance in interface MBeanServer (src) name - the object name of the mbean
InstanceNotFoundException (src) - if the mbean is not registered
in the MBeanServer
public java.util.Set queryMBeans(ObjectName (src) name,
QueryExp (src) query)
MBeanServer (src)
queryMBeans in interface MBeanServer (src) name - an ObjectName pattern, can be null for all mbeansquery - a query expression to further filter the mbeans, can be null
for no query
public java.util.Set queryNames(ObjectName (src) name,
QueryExp (src) query)
MBeanServer (src)
queryNames in interface MBeanServer (src) name - an ObjectName pattern, can be null for all mbeansquery - a query expression to further filter the mbeans, can be null
for no querypublic boolean isRegistered(ObjectName (src) name)
MBeanServer (src)
isRegistered in interface MBeanServer (src) name - the object name of the mbean
public java.lang.Integer getMBeanCount()
MBeanServer (src)
getMBeanCount in interface MBeanServer (src)
public java.lang.Object getAttribute(ObjectName (src) name,
java.lang.String attribute)
throws MBeanException (src) ,
AttributeNotFoundException (src) ,
InstanceNotFoundException (src) ,
ReflectionException (src)
MBeanServer (src)
getAttribute in interface MBeanServer (src) name - the object name of the mbeanattribute - the attribute name of the value to retrieve
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
public AttributeList (src) getAttributes(ObjectName (src) name,
java.lang.String[] attributes)
throws InstanceNotFoundException (src) ,
ReflectionException (src)
MBeanServer (src)
getAttributes in interface MBeanServer (src) name - the object name of the mbeanattributes - the attribute names of the values to retrieve
ReflectionException (src) - for an exception invoking the mbean
InstanceNotFoundException (src) - if the mbean is not registered
public void setAttribute(ObjectName (src) name,
Attribute (src) attribute)
throws InstanceNotFoundException (src) ,
AttributeNotFoundException (src) ,
InvalidAttributeValueException (src) ,
MBeanException (src) ,
ReflectionException (src)
MBeanServer (src)
setAttribute in interface MBeanServer (src) name - the object name of the mbeanattribute - the attribute name and value to set
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
public AttributeList (src) setAttributes(ObjectName (src) name,
AttributeList (src) attributes)
throws InstanceNotFoundException (src) ,
ReflectionException (src)
MBeanServer (src)
setAttributes in interface MBeanServer (src) name - the object name of the mbeanattributes - the attribute names and values to set
InstanceNotFoundException (src) - if the mbean is not registered
ReflectionException (src) - for an exception invoking the mbean
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)
MBeanServer (src)
invoke in interface MBeanServer (src) name - the object name of the mbeanoperationName - the operation to performparams - the parameterssignature - the signature of the operation
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
public MBeanInfo (src) getMBeanInfo(ObjectName (src) name)
throws InstanceNotFoundException (src) ,
IntrospectionException (src) ,
ReflectionException (src)
MBeanServer (src)
getMBeanInfo in interface MBeanServer (src) name - the name of the mbean
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 registeredpublic java.lang.String getDefaultDomain()
MBeanServer (src)
getDefaultDomain in interface MBeanServer (src) public java.lang.String[] getDomains()
MBeanServer (src)
getDomains in interface MBeanServer (src)
public void addNotificationListener(ObjectName (src) name,
NotificationListener (src) listener,
NotificationFilter (src) filter,
java.lang.Object handback)
throws InstanceNotFoundException (src)
addNotificationListener in interface MBeanServer (src) name - the name of the MBean broadcasting notificationslistener - the listener to addfilter - a filter to preprocess notificationshandback - a object to add to any notifications
InstanceNotFoundException (src) - if the broadcaster is not registered
public void addNotificationListener(ObjectName (src) name,
ObjectName (src) listener,
NotificationFilter (src) filter,
java.lang.Object handback)
throws InstanceNotFoundException (src)
addNotificationListener in interface MBeanServer (src) name - the name of the MBean broadcasting notificationslistener - the object name listener to addfilter - a filter to preprocess notificationshandback - a object to add to any notifications
InstanceNotFoundException (src) - if the broadcaster or listener is not registered
public void removeNotificationListener(ObjectName (src) name,
NotificationListener (src) listener)
throws InstanceNotFoundException (src) ,
ListenerNotFoundException (src)