| javax.management.MBeanServer
MBeanServer | abstract public interface MBeanServer (Code) | | This is the interface for MBean manipulation on the agent side. It contains
the methods necessary for the creation, registration, and deletion of MBeans
as well as the access methods for registered MBeans. This is the core
component of the JMX infrastructure.
Every MBean which is added to the MBean server becomes manageable: its
attributes and operations become remotely accessible through the
connectors/adaptors connected to that MBean server. A Java object cannot be
registered in the MBean server unless it is a JMX compliant MBean.
When an MBean is registered or unregistered in the MBean server an
javax.management.MBeanServerNotification MBeanServerNotification Notification is emitted. To register an object as listener to
MBeanServerNotifications you should call the MBean server method
MBeanServer.addNotificationListener addNotificationListener with
ObjectName the ObjectName of the
javax.management.MBeanServerDelegate MBeanServerDelegate .
This ObjectName is:
JMImplementation:type=MBeanServerDelegate .
|
Method Summary | |
public void | addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) Enables a couple (listener,handback) for a registered MBean to be added.
Parameters: name - The name of the MBean on which the listener should be added. Parameters: listener - The listener object which will handles notificationsemitted by the registered MBean. Parameters: filter - The filter object. | public void | addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) Enables a couple (listener,handback) for a registered MBean to be added.
Parameters: name - The name of the MBean on which the listener should be added. Parameters: listener - The listener name which will handles notificationsemitted by the registered MBean. Parameters: filter - The filter object. | public ObjectInstance | createMBean(String className, ObjectName name) Instantiates and registers an MBean in the MBean server.
The MBean server will use the
javax.management.loading.DefaultLoaderRepository Default Loader Repository to load the class of the MBean. | public ObjectInstance | createMBean(String className, ObjectName name, Object[] params, String[] signature) Instantiates and registers an MBean in the MBean server.
The MBean server will use the
javax.management.loading.DefaultLoaderRepository Default Loader Repository to load the class of the MBean.
An object name is associated to the MBean. | public ObjectInstance | createMBean(String className, ObjectName name, ObjectName loaderName) Instantiates and registers an MBean in the MBean server. | public ObjectInstance | createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature) Instantiates and registers an MBean in the MBean server. | public ObjectInputStream | deserialize(ObjectName name, byte[] data) De-serializes a byte array in the context of the class loader of an MBean.
Parameters: name - The name of the MBean whose class loader should be usedfor the de-serialization. Parameters: data - The byte array to be de-sererialized. | public ObjectInputStream | deserialize(String className, byte[] data) De-serializes a byte array in the context of a given MBean class loader.
The class loader is the one that loaded the class with name "className".
Parameters: className - The name of the class whose class loader should be usedfor the de-serialization. Parameters: data - The byte array to be de-sererialized. | public ObjectInputStream | deserialize(String className, ObjectName loaderName, byte[] data) De-serializes a byte array in the context of a given MBean class loader.
The class loader is the one that loaded the class with name "className".
The name of the class loader to be used for loading the specified class
is specified. | public Object | getAttribute(ObjectName name, String attribute) Gets the value of a specific attribute of a named MBean. | public AttributeList | getAttributes(ObjectName name, String[] attributes) Enables the values of several attributes of a named MBean. | public String | getDefaultDomain() Returns the default domain used for naming the MBean. | public Integer | getMBeanCount() Returns the number of MBeans controlled by the MBeanServer. | public MBeanInfo | getMBeanInfo(ObjectName name) This method discovers the attributes and operations that an MBean exposes
for management. | public ObjectInstance | getObjectInstance(ObjectName name) Gets the ObjectInstance for a given MBean registered
with the MBean server.
Parameters: name - The object name of the MBean. | public java.lang.Object | instantiate(String className) Instantiates an object using the list of all class loaders registered
in the MBean server
(
javax.management.loading.DefaultLoaderRepository Default Loader Repository ).
The object's class should have a public constructor. | public java.lang.Object | instantiate(String className, Object[] params, String[] signature) Instantiates an object using the list of all class loaders registered
in the MBean server
(
javax.management.loading.DefaultLoaderRepository Default Loader Repository ).
The object's class should have a public constructor. | public java.lang.Object | instantiate(String className, ObjectName loaderName) Instantiates an object using the class Loader specified by its
ObjectName . | public java.lang.Object | instantiate(String className, ObjectName loaderName, Object[] params, String[] signature) Instantiates an object. | public Object | invoke(ObjectName name, String actionName, Object[] params, String[] signature) Invokes an operation on an MBean.
Parameters: name - The object name of the MBean on which the method is to be invoked. Parameters: operationName - The name of the operation to be invoked. Parameters: params - An array containing the parameters to be set whenthe operation is invoked. Parameters: signature - An array containing the signature of the operation.The class objects will be loaded using the sameclass loader as the one used for loading the MBean onwhich the operation was invoked. | public boolean | isInstanceOf(ObjectName name, String className) Returns true if the MBean specified is an instance of the specified
class, false otherwise.
Parameters: name - The ObjectName of the MBean. Parameters: className - The name of the class. | public boolean | isRegistered(ObjectName name) Checks whether an MBean, identified by its object name, is already
registered with the MBean server.
Parameters: name - The object name of the MBean to be checked. | public Set | queryMBeans(ObjectName name, QueryExp query) Gets MBeans controlled by the MBean server. | public Set | queryNames(ObjectName name, QueryExp query) Gets the names of MBeans controlled by the MBean server. | public ObjectInstance | registerMBean(Object object, ObjectName name) Registers a pre-existing object as an MBean with the MBean server. | public void | removeNotificationListener(ObjectName name, NotificationListener listener) Enables to remove a listener from a registered MBean.
Parameters: name - The name of the MBean on which the listener should be removed. Parameters: listener - The listener object which will handle the notificationsemitted by the registered MBean. | public void | removeNotificationListener(ObjectName name, ObjectName listener) Enables to remove a listener from a registered MBean.
Parameters: name - The name of the MBean on which the listener should be removed. Parameters: listener - The object name of the listener which will handle thenotifications emitted by the registered MBean. | public void | setAttribute(ObjectName name, Attribute attribute) Sets the value of a specific attribute of a named MBean. | public AttributeList | setAttributes(ObjectName name, AttributeList attributes) Sets the values of several attributes of a named MBean. | public void | unregisterMBean(ObjectName name) De-registers an MBean from the MBean server. |
addNotificationListener | public void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException(Code) | | Enables a couple (listener,handback) for a registered MBean to be added.
Parameters: name - The name of the MBean on which the listener should be added. Parameters: listener - The listener object which will handles notificationsemitted by the registered MBean. Parameters: filter - The filter object. If not specified, no filtering will beperformed before handling notifications. Parameters: handback - The context to be sent to the listener when anotification is emitted. exception: javax.management.InstanceNotFoundException - The MBean namedoesn't correspond to a registered MBean. |
addNotificationListener | public void addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException(Code) | | Enables a couple (listener,handback) for a registered MBean to be added.
Parameters: name - The name of the MBean on which the listener should be added. Parameters: listener - The listener name which will handles notificationsemitted by the registered MBean. Parameters: filter - The filter object. If not specified, no filtering will beperformed before handling notifications. Parameters: handback - The context to be sent to the listener when anotification is emitted. exception: javax.management.InstanceNotFoundException - The MBean namedoesn't correspond to a registered MBean. |
createMBean | public ObjectInstance createMBean(String className, ObjectName name, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException(Code) | | Instantiates and registers an MBean in the MBean server.
The MBean server will use the
javax.management.loading.DefaultLoaderRepository Default Loader Repository to load the class of the MBean.
An object name is associated to the MBean. If the object name given is
null, the MBean can automatically provide its own name by implementing
the
javax.management.MBeanRegistration MBeanRegistration interface. The call returns an ObjectInstance object
representing the newly created MBean.
Parameters: className - The class name of the MBean to be instantiated. Parameters: name - The object name of the MBean. May be null. Parameters: params - An array containing the parameters of constructor to be invoked. Parameters: signature - An array containing the signature of constructor to be invoked. An ObjectInstance , containing theObjectName and the Java class name ofthe newly instantiated MBean. exception: ReflectionException - Wraps ajava.lang.ClassNotFoundException or a java.lang.Exception that occurredwhen trying to invoke the MBean's constructor. exception: InstanceAlreadyExistsException - The MBean is already underthe control of the MBean server. exception: MBeanRegistrationException - The preRegister (MBeanRegistration interface) method of theMBean has thrown an exception. The MBean will not be registered. exception: MBeanException - The constructor of the MBean has thrown an exception. exception: RuntimeOperationsException - Wraps ajava.lang.IllegalArgumentException :The className passed in parameter is null,the ObjectName passed in parameter contains a patternor no ObjectName is specified for the MBean. |
createMBean | public ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException(Code) | | Instantiates and registers an MBean in the MBean server. The class loader
to be used is identified by its object name. An object name is associated
to the MBean. If the object name of the loader is null, the ClassLoader
that loaded the MBean server will be used. If the MBean's object name
given is null, the MBean can automatically provide its own name by
implementing the
javax.management.MBeanRegistration MBeanRegistration interface. The call returns an ObjectInstance object
representing the newly created MBean.
Parameters: className - The class name of the MBean to be instantiated. Parameters: name - The object name of the MBean. May be null. Parameters: loaderName - The object name of the class loader to be used. An ObjectInstance , containing theObjectName and the Java class name ofthe newly instantiated MBean. exception: ReflectionException - Wraps ajava.lang.ClassNotFoundException or a java.lang.Exception that occurredwhen trying to invoke the MBean's constructor. exception: InstanceAlreadyExistsException - The MBean is already underthe control of the MBean server. exception: MBeanRegistrationException - The preRegister (MBeanRegistration interface) method of theMBean has thrown an exception. The MBean will not be registered. exception: MBeanException - The constructor of the MBean has thrown an exception. exception: NotCompliantMBeanException - This class is not a JMX compliant MBean. exception: InstanceNotFoundException - The specified class loaderis not registered in the MBean server. exception: RuntimeOperationsException - Wraps ajava.lang.IllegalArgumentException :The className passed in parameter is null,the ObjectName passed in parameter contains a patternor no ObjectName is specified for the MBean. |
createMBean | public ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException(Code) | | Instantiates and registers an MBean in the MBean server. The class loader
to be used is identified by its object name. An object name is associated
to the MBean. If the object name of the loader is not specified, the
ClassLoader that loaded the MBean server will be used. If the MBean
object name given is null, the MBean can automatically provide its own
name by implementing the
javax.management.MBeanRegistration MBeanRegistration interface.
The call returns an ObjectInstance object representing
the newly created MBean.
Parameters: className - The class name of the MBean to be instantiated. Parameters: name - The object name of the MBean. May be null. Parameters: params - An array containing the parameters of constructor to be invoked. Parameters: signature - An array containing the signature of constructor to be invoked. Parameters: loaderName - The object name of the class loader to be used. An ObjectInstance , containing theObjectName and the Java class name ofthe newly instantiated MBean. exception: ReflectionException - Wraps ajava.lang.ClassNotFoundException or a java.lang.Exception that occurredwhen trying to invoke the MBean's constructor. exception: InstanceAlreadyExistsException - The MBean is already underthe control of the MBean server. exception: MBeanRegistrationException - The preRegister (MBeanRegistration interface) method of theMBean has thrown an exception. The MBean will not be registered. exception: MBeanException - The constructor of the MBean has thrown an exception. exception: InstanceNotFoundException - The specified class loaderis not registered in the MBean server. exception: RuntimeOperationsException - Wraps ajava.lang.IllegalArgumentException :The className passed in parameter is null,the ObjectName passed in parameter contains a patternor no ObjectName is specified for the MBean. |
deserialize | public ObjectInputStream deserialize(String className, byte[] data) throws OperationsException, ReflectionException(Code) | | De-serializes a byte array in the context of a given MBean class loader.
The class loader is the one that loaded the class with name "className".
Parameters: className - The name of the class whose class loader should be usedfor the de-serialization. Parameters: data - The byte array to be de-sererialized. The de-serialized object stream. exception: OperationsException - Any of the usual Input/Output related exceptions. exception: ReflectionException - The specified class could not beloaded by the default loader repository. |
deserialize | public ObjectInputStream deserialize(String className, ObjectName loaderName, byte[] data) throws InstanceNotFoundException, OperationsException, ReflectionException(Code) | | De-serializes a byte array in the context of a given MBean class loader.
The class loader is the one that loaded the class with name "className".
The name of the class loader to be used for loading the specified class
is specified. If null, the MBean Server's class loader will be used.
Parameters: className - The name of the class whose class loader should beused for the de-serialization. Parameters: data - The byte array to be de-sererialized. Parameters: loaderName - The name of the class loader to be used forloading the specified class. If null, the MBean Server'sclass loader will be used. The de-serialized object stream. exception: InstanceNotFoundException - The specified class loader MBeanis not found. exception: OperationsException - Any of the usual Input/Output related exceptions. exception: ReflectionException - The specified class could not beloaded by the specified class loader. |
getAttributes | public AttributeList getAttributes(ObjectName name, String[] attributes) throws InstanceNotFoundException, ReflectionException(Code) | | Enables the values of several attributes of a named MBean. The MBean
is identified by its object name.
Parameters: name - The object name of the MBean from which the attributes areretrieved. Parameters: attributes - A list of the attributes to be retrieved. The list of the retrieved attributes. exception: InstanceNotFoundException - The MBean specified isnot registered in the MBean server. exception: ReflectionException - An exception occurred when trying toinvoke the getAttributes method of a Dynamic MBean. exception: RuntimeOperationsException - Wrap ajava.lang.IllegalArgumentException :The object name in parameter is nullor attributes in parameter is null. |
getDefaultDomain | public String getDefaultDomain()(Code) | | Returns the default domain used for naming the MBean. The default
domain name is used as the domain part in the ObjectName of MBeans
if no domain is specified by the user.
|
getMBeanCount | public Integer getMBeanCount()(Code) | | Returns the number of MBeans controlled by the MBeanServer.
|
instantiate | public java.lang.Object instantiate(String className) throws ReflectionException, MBeanException(Code) | | Instantiates an object using the list of all class loaders registered
in the MBean server
(
javax.management.loading.DefaultLoaderRepository Default Loader Repository ).
The object's class should have a public constructor. It returns a
reference to the newly created object. The newly created object is
not registered in the MBean server.
Parameters: className - The class name of the object to be instantiated. The newly instantiated object. exception: ReflectionException - Wraps ajava.lang.ClassNotFoundException or the java.lang.Exception that occurredwhen trying to invoke the object's constructor. exception: MBeanException - The constructor of the object has thrown an exception. exception: RuntimeOperationsException - Wraps ajava.lang.IllegalArgumentException :The className passed in parameter is null. |
instantiate | public java.lang.Object instantiate(String className, Object[] params, String[] signature) throws ReflectionException, MBeanException(Code) | | Instantiates an object using the list of all class loaders registered
in the MBean server
(
javax.management.loading.DefaultLoaderRepository Default Loader Repository ).
The object's class should have a public constructor. The call returns
a reference to the newly created object. The newly created object is
not registered in the MBean server.
Parameters: className - The class name of the object to be instantiated. Parameters: params - An array containing the parameters of the constructor to be invoked. Parameters: signature - An array containing the signature of the constructor to be invoked. The newly instantiated object. exception: ReflectionException - Wraps ajava.lang.ClassNotFoundException or the java.lang.Exception that occurredwhen trying to invoke the object's constructor. exception: MBeanException - The constructor of the object has thrown an exception exception: RuntimeOperationsException - Wraps ajava.lang.IllegalArgumentException :The className passed in parameter is null. |
instantiate | public java.lang.Object instantiate(String className, ObjectName loaderName) throws ReflectionException, MBeanException, InstanceNotFoundException(Code) | | Instantiates an object using the class Loader specified by its
ObjectName . If the loader name is null, the ClassLoader
that loaded the MBean Server will be used. The object's class should
have a public constructor. It returns a reference to the newly created
object. The newly created object is not registered in the MBean server.
Parameters: className - The class name of the MBean to be instantiated. Parameters: loaderName - The object name of the class loader to be used. The newly instantiated object. exception: ReflectionException - Wraps ajava.lang.ClassNotFoundException or the java.lang.Exception that occurredwhen trying to invoke the object's constructor. exception: MBeanException - The constructor of the object has thrown an exception. exception: InstanceNotFoundException - The specified class loader isnot registered in the MBaenServer. exception: RuntimeOperationsException - Wraps ajava.lang.IllegalArgumentException :The className passed in parameter is null. |
instantiate | public java.lang.Object instantiate(String className, ObjectName loaderName, Object[] params, String[] signature) throws ReflectionException, MBeanException, InstanceNotFoundException(Code) | | Instantiates an object. The class loader to be used is identified by
its object name. If the object name of the loader is null, the
ClassLoader that loaded the MBean server will be used. The object's
class should have a public constructor. The call returns a reference
to the newly created object. The newly created object is not
registered in the MBean server.
Parameters: className - The class name of the object to be instantiated. Parameters: params - An array containing the parameters of the constructor to be invoked. Parameters: signature - An array containing the signature of the constructor to be invoked. Parameters: loaderName - The object name of the class loader to be used. The newly instantiated object. exception: ReflectionException - Wraps ajava.lang.ClassNotFoundException or the java.lang.Exception that occurredwhen trying to invoke the object's constructor. exception: MBeanException - The constructor of the object has thrownan exception. exception: InstanceNotFoundException - The specified class loader isnot registered in the MBean server. exception: RuntimeOperationsException - Wraps ajava.lang.IllegalArgumentException :The className passed in parameter is null. |
invoke | public Object invoke(ObjectName name, String actionName, Object[] params, String[] signature) throws InstanceNotFoundException, MBeanException, ReflectionException(Code) | | Invokes an operation on an MBean.
Parameters: name - The object name of the MBean on which the method is to be invoked. Parameters: operationName - The name of the operation to be invoked. Parameters: params - An array containing the parameters to be set whenthe operation is invoked. Parameters: signature - An array containing the signature of the operation.The class objects will be loaded using the sameclass loader as the one used for loading the MBean onwhich the operation was invoked. The object returned by the operation, which represents theresult ofinvoking the operation on the MBean specified. exception: InstanceNotFoundException - The MBean specified isnot registered in the MBean server. exception: MBeanException - Wraps an exception thrown by the MBean's invoked method. exception: ReflectionException - Wraps a java.lang.Exception thrown while trying to invoke the method. |
isInstanceOf | public boolean isInstanceOf(ObjectName name, String className) throws InstanceNotFoundException(Code) | | Returns true if the MBean specified is an instance of the specified
class, false otherwise.
Parameters: name - The ObjectName of the MBean. Parameters: className - The name of the class. true if the MBean specified is an instance of thespecified class, false otherwise. exception: InstanceNotFoundException - The MBean specified is notregistered in the MBean server. |
isRegistered | public boolean isRegistered(ObjectName name)(Code) | | Checks whether an MBean, identified by its object name, is already
registered with the MBean server.
Parameters: name - The object name of the MBean to be checked. True if the MBean is already registered in theMBean server, false otherwise. exception: RuntimeOperationsException - Wraps ajava.lang.IllegalArgumentException :The object name in parameter is null. |
queryMBeans | public Set queryMBeans(ObjectName name, QueryExp query)(Code) | | Gets MBeans controlled by the MBean server. This method allows any of
the following to be obtained: All MBeans, a set of MBeans specified
by pattern matching on the ObjectName and/or a
Query expression, a specific MBean. When the object name is null or
no domain and key properties are specified, all objects are to be
selected (and filtered if a query is specified). It returns the set
of ObjectInstance objects (containing the
ObjectName and the Java Class name) for the selected MBeans.
Parameters: name - The object name pattern identifying the MBeans to beretrieved. If null or no domain and key properties arespecified, all the MBeans registered will be retrieved. Parameters: query - The query expression to be applied for selecting MBeans. Ifnull no query expression will be applied for selecting MBeans. A set containing the ObjectInstance objects forthe selected MBeans. If no MBean satisfies the queryan empty list is returned. |
queryNames | public Set queryNames(ObjectName name, QueryExp query)(Code) | | Gets the names of MBeans controlled by the MBean server. This method
enables any of the following to be obtained: The names of all MBeans,
the names of a set of MBeans specified by pattern matching on the
ObjectName and/or a Query expression, a specific MBean name
(equivalent to testing whether an MBean is registered). When the
object name is null or no domain and key properties are specified,
all objects are selected (and filtered if a query is specified). It
returns the set of ObjectNames for the MBeans selected.
Parameters: name - The object name pattern identifying the MBeans to beretrieved. If null or no domain and key properties arespecified, all the MBeans registered will be retrieved. Parameters: query - The query expression to be applied for selecting MBeans. Ifnull no query expression will be applied for selecting MBeans. A set containing the ObjectNames for the MBeans selected. Ifno MBean satisfies the query, an empty list is returned. |
removeNotificationListener | public void removeNotificationListener(ObjectName name, NotificationListener listener) throws InstanceNotFoundException, ListenerNotFoundException(Code) | | Enables to remove a listener from a registered MBean.
Parameters: name - The name of the MBean on which the listener should be removed. Parameters: listener - The listener object which will handle the notificationsemitted by the registered MBean. This method will removeall the information related to this listener. exception: InstanceNotFoundException - The MBean name provideddoes not match any of the registered MBeans. exception: ListenerNotFoundException - The couple (listener,handback)is not registered in the MBean. The exception messagecontains either "listener", "handback" or the object namedepending on which object cannot be found. |
removeNotificationListener | public void removeNotificationListener(ObjectName name, ObjectName listener) throws InstanceNotFoundException, ListenerNotFoundException(Code) | | Enables to remove a listener from a registered MBean.
Parameters: name - The name of the MBean on which the listener should be removed. Parameters: listener - The object name of the listener which will handle thenotifications emitted by the registered MBean. This methodwill remove all the information related to this listener. exception: InstanceNotFoundException - The MBean name provideddoes not match any of the registered MBeans. exception: ListenerNotFoundException - The couple (listener,handback) isnot registered in the MBean. The exception messagecontains either "listener", "handback" or the object namedepending on which object cannot be found. |
setAttributes | public AttributeList setAttributes(ObjectName name, AttributeList attributes) throws InstanceNotFoundException, ReflectionException(Code) | | Sets the values of several attributes of a named MBean. The MBean is
identified by its object name.
Parameters: name - The object name of the MBean within which the attributesare to be set. Parameters: attributes - A list of attributes: The identification of theattributes to be set and the values they are to be set to. The list of attributes that were set, with their new values. exception: InstanceNotFoundException - The MBean specified isnot registered in the MBean server. exception: ReflectionException - An exception occurred when trying toinvoke the getAttributes method of a Dynamic MBean. exception: RuntimeOperationsException - Wraps ajava.lang.IllegalArgumentException :The object name in parameter is nullor attributes in parameter is null. |
|
|