| javax.management.MBeanServerConnection
All known Subclasses: mx4j.tools.remote.local.LocalConnectionMBeanServerConnection,
MBeanServerConnection | public interface MBeanServerConnection (Code) | | This interface allows clients (local or remote) to create, register, unregister and access registered MBeans.
version: $Revision: 1.4 $ See Also: MBeanServer since: JMX 1.2 |
Method Summary | |
public void | addNotificationListener(ObjectName observed, NotificationListener listener, NotificationFilter filter, Object handback) Adds a NotificationListener to a registered MBean.
A notification emitted by the specified source MBean will be forwarded by the MBeanServer to the given listener,
if the given NotificationFilter allows so. | public void | addNotificationListener(ObjectName observed, ObjectName listener, NotificationFilter filter, Object handback) Adds a NotificationListener to a registered MBean.
A notification emitted by the specified source MBean will be forwarded by the MBeanServer to the given listener MBean,
if the given NotificationFilter allows so. | public ObjectInstance | createMBean(String className, ObjectName objectName) A facility method for createMBean(className, objectName, null, null) . | public ObjectInstance | createMBean(String className, ObjectName objectName, Object[] args, String[] parameters) Instantiates and registers an MBean of the specified class with the given ObjectName in the MBeanServer.
The MBeanServer will use its ClassLoaderRepository to load the class of the MBean and the specified
constructor's parameter classes, and creates the instance passing the specified arguments.
The ObjectName may be null if the MBean implements
MBeanRegistration Parameters: className - The class name of the MBean to be instantiated. Parameters: objectName - The ObjectName of the MBean, may be null. Parameters: args - An array containing the arguments to pass to the constructor. Parameters: parameters - An array containing the signature of the constructor. | public ObjectInstance | createMBean(String className, ObjectName objectName, ObjectName loaderName) A facility method for createMBean(className, objectName, loaderName, null, null) . | public ObjectInstance | createMBean(String className, ObjectName objectName, ObjectName loaderName, Object[] args, String[] parameters) Instantiates and registers an MBean of the specified class with the given ObjectName in the MBeanServer.
The MBeanServer will use the specified classloader MBean to load the class of the MBean and the specified
constructor's parameter classes, and creates the instance passing the specified arguments, or the classloader
of the MBeanServer if the classloader ObjectName is null.
The ObjectName may be null if the MBean implements
MBeanRegistration Parameters: className - The class name of the MBean to be instantiated. Parameters: objectName - The ObjectName of the MBean, may be null. Parameters: loaderName - The ObjectName of the classloader MBean to be used. Parameters: args - An array containing the arguments to pass to the constructor. Parameters: parameters - An array containing the signature of the constructor. | public Object | getAttribute(ObjectName objectName, String attribute) Gets the value of the specified attribute of the named MBean.
Parameters: objectName - The ObjectName of the MBean from which the attribute is to be retrieved. Parameters: attribute - The attribute name. | public AttributeList | getAttributes(ObjectName objectName, String[] attributes) Gets the values of several attributes of the named MBean.
Parameters: objectName - The ObjectName of the MBean from which the attributes are to be retrieved. Parameters: attributes - The attribute names. | public String | getDefaultDomain() Returns the default domain for this MBeanServer used in case ObjectName domain are not specified. | public String[] | getDomains() Returns the list of different ObjectName domains under which the MBeans in this MBeanServer are registered. | public Integer | getMBeanCount() Returns the number of MBeans registered in this MBeanServer. | public MBeanInfo | getMBeanInfo(ObjectName objectName) Returns the metadata information exposed for management about the named MBean.
Parameters: objectName - The name of the MBean for which retrieve the metadata. | public ObjectInstance | getObjectInstance(ObjectName objectName) Gets the ObjectInstance for the named MBean registered with the MBeanServer.
Parameters: objectName - The ObjectName of the MBean. | public Object | invoke(ObjectName objectName, String methodName, Object[] args, String[] parameters) Invokes the specified operation on the named MBean.
Parameters: objectName - The ObjectName of the MBean on which the method is to be invoked. Parameters: methodName - The name of the operation to be invoked. Parameters: args - An array containing the arguments to pass to the operation. Parameters: parameters - An array containing the signature of the operation. | public boolean | isInstanceOf(ObjectName objectName, String className) Returns whether the MBean specified is an instance of the specified class.
Parameters: objectName - The ObjectName of the MBean. Parameters: className - The name of the class. | public boolean | isRegistered(ObjectName objectName) Checks whether the given ObjectName identifies an MBean registered in this MBeanServer.
Parameters: objectName - The ObjectName to be checked. | public Set | queryMBeans(ObjectName patternName, QueryExp filter) Gets a subset of the ObjectInstances belonging to MBeans registered in this MBeanServer.
It is possible to filter the set of MBeans by specifying a pattern for MBean's ObjectNames, and a query expression
to be evaluated to further filter the set of MBeans.
The set can be further restricted if any exception is thrown during retrieval of MBean (for example for
security reasons): the failing MBean will not be included.
Parameters: patternName - The ObjectName pattern identifying the MBeans to be retrieved, or null to retrieve all MBeans. Parameters: filter - The query expression to be evaluated for selecting MBeans, or null. | public Set | queryNames(ObjectName patternName, QueryExp filter) Gets a subset of the ObjectNames belonging to MBeans registered in this MBeanServer.
It is possible to filter the set of MBeans by specifying a pattern for MBean's ObjectNames, and a query expression
to be evaluated to further filter the set of MBeans.
The set can be further restricted if any exception is thrown during retrieval of MBean (for example for
security reasons): the failing MBean will not be included.
Parameters: patternName - The ObjectName pattern identifying the MBeans to be retrieved, or null to retrieve all MBeans. Parameters: filter - The query expression to be evaluated for selecting MBeans, or null. | public void | removeNotificationListener(ObjectName observed, NotificationListener listener) Removes the specified listener from the named source MBean. | public void | removeNotificationListener(ObjectName observed, ObjectName listener) Removes the specified listener MBean from the named source MBean. | public void | removeNotificationListener(ObjectName observed, NotificationListener listener, NotificationFilter filter, Object handback) Removes the specified listener from the named source MBean. | public void | removeNotificationListener(ObjectName observed, ObjectName listener, NotificationFilter filter, Object handback) Removes the specified listener MBean from the named source MBean. | public void | setAttribute(ObjectName objectName, Attribute attribute) Sets the value of the specified attribute of the named MBean. | public AttributeList | setAttributes(ObjectName objectName, AttributeList attributes) Sets the values of several attributes of the named MBean.
Parameters: objectName - The name of the MBean within which the attribute is to be set. Parameters: attributes - The AttributeList containing the Attributes to be set. | public void | unregisterMBean(ObjectName objectName) Unregisters the MBean with the specified ObjectName from this MBeanServer. |
addNotificationListener | public void addNotificationListener(ObjectName observed, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, IOException(Code) | | Adds a NotificationListener to a registered MBean.
A notification emitted by the specified source MBean will be forwarded by the MBeanServer to the given listener,
if the given NotificationFilter allows so. If the filter is null, every notification will be sent to the
listener.
The handback object is transparently passed to the listener by the MBeanServer.
The source of the notification is the source MBean ObjectName.
Parameters: observed - The ObjectName of the source MBean on which the listener should be added. Parameters: listener - The listener which will handle the notifications emitted by the source MBean. Parameters: filter - The filter which will allow the notification to be forwarded to the listener. Parameters: handback - The context to be sent to the listener when a notification is emitted. throws: InstanceNotFoundException - If the source MBean is not registered in the MBeanServer. throws: IOException - If a communication problem occurred. See Also: MBeanServerConnection.removeNotificationListener(ObjectName,NotificationListener,NotificationFilter,Object) |
addNotificationListener | public void addNotificationListener(ObjectName observed, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, IOException(Code) | | Adds a NotificationListener to a registered MBean.
A notification emitted by the specified source MBean will be forwarded by the MBeanServer to the given listener MBean,
if the given NotificationFilter allows so. If the filter is null, every notification will be sent to the
listener.
The handback object is transparently passed to the listener by the MBeanServer.
The source of the notification is the source MBean ObjectName.
If the listener MBean is unregistered, it will continue to receive notifications.
Parameters: observed - The ObjectName of the source MBean on which the listener should be added. Parameters: listener - The ObjectName of the listener MBean which will handle the notifications emitted by the source MBean. Parameters: filter - The filter which will allow the notification to be forwarded to the listener. Parameters: handback - The context to be sent to the listener when a notification is emitted. throws: InstanceNotFoundException - If the source or listener MBean are not registered in the MBeanServer. throws: IOException - If a communication problem occurred. See Also: MBeanServerConnection.removeNotificationListener(ObjectName,ObjectName,NotificationFilter,Object) |
createMBean | public ObjectInstance createMBean(String className, ObjectName objectName) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, IOException(Code) | | A facility method for createMBean(className, objectName, null, null) .
See Also: MBeanServerConnection.createMBean(String,ObjectName,Object[],String[]) |
createMBean | public ObjectInstance createMBean(String className, ObjectName objectName, Object[] args, String[] parameters) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, IOException(Code) | | Instantiates and registers an MBean of the specified class with the given ObjectName in the MBeanServer.
The MBeanServer will use its ClassLoaderRepository to load the class of the MBean and the specified
constructor's parameter classes, and creates the instance passing the specified arguments.
The ObjectName may be null if the MBean implements
MBeanRegistration Parameters: className - The class name of the MBean to be instantiated. Parameters: objectName - The ObjectName of the MBean, may be null. Parameters: args - An array containing the arguments to pass to the constructor. Parameters: parameters - An array containing the signature of the constructor. An ObjectInstance, containing the ObjectName and the Java class name of the newly instantiated MBean. throws: ReflectionException - If a reflection exception is thrown. throws: InstanceAlreadyExistsException - If another MBean with the same ObjectName is already registered in the MBeanServer. throws: MBeanRegistrationException - If an exception is thrown during MBean's registration. throws: MBeanException - If the constructor of the MBean has thrown an exception throws: NotCompliantMBeanException - If the MBean is not a JMX compliant MBean throws: IOException - If a communication problem occurred. |
createMBean | public ObjectInstance createMBean(String className, ObjectName objectName, ObjectName loaderName) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException, IOException(Code) | | A facility method for createMBean(className, objectName, loaderName, null, null) .
See Also: MBeanServerConnection.createMBean(String,ObjectName,ObjectName,Object[],String[]) |
createMBean | public ObjectInstance createMBean(String className, ObjectName objectName, ObjectName loaderName, Object[] args, String[] parameters) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException, IOException(Code) | | Instantiates and registers an MBean of the specified class with the given ObjectName in the MBeanServer.
The MBeanServer will use the specified classloader MBean to load the class of the MBean and the specified
constructor's parameter classes, and creates the instance passing the specified arguments, or the classloader
of the MBeanServer if the classloader ObjectName is null.
The ObjectName may be null if the MBean implements
MBeanRegistration Parameters: className - The class name of the MBean to be instantiated. Parameters: objectName - The ObjectName of the MBean, may be null. Parameters: loaderName - The ObjectName of the classloader MBean to be used. Parameters: args - An array containing the arguments to pass to the constructor. Parameters: parameters - An array containing the signature of the constructor. An ObjectInstance, containing the ObjectName and the Java class name of the newly instantiated MBean. throws: ReflectionException - If a reflection exception is thrown. throws: InstanceAlreadyExistsException - If another MBean with the same ObjectName is already registered in the MBeanServer. throws: MBeanRegistrationException - If an exception is thrown during MBean's registration. throws: MBeanException - If the constructor of the MBean has thrown an exception throws: NotCompliantMBeanException - If the MBean is not a JMX compliant MBean throws: InstanceNotFoundException - If the specified classloader MBean is not registered in the MBeanServer. throws: IOException - If a communication problem occurred. |
getDefaultDomain | public String getDefaultDomain() throws IOException(Code) | | Returns the default domain for this MBeanServer used in case ObjectName domain are not specified.
The default domain of this MBeanServer. throws: IOException - If a communication problem occurred. |
getDomains | public String[] getDomains() throws IOException(Code) | | Returns the list of different ObjectName domains under which the MBeans in this MBeanServer are registered.
The array of different ObjectName domains present in this MBeanServer. throws: IOException - If a communication problem occurred. since: JMX 1.2 |
getMBeanCount | public Integer getMBeanCount() throws IOException(Code) | | Returns the number of MBeans registered in this MBeanServer.
throws: IOException - If a communication problem occurred. |
invoke | public Object invoke(ObjectName objectName, String methodName, Object[] args, String[] parameters) throws InstanceNotFoundException, MBeanException, ReflectionException, IOException(Code) | | Invokes the specified operation on the named MBean.
Parameters: objectName - The ObjectName of the MBean on which the method is to be invoked. Parameters: methodName - The name of the operation to be invoked. Parameters: args - An array containing the arguments to pass to the operation. Parameters: parameters - An array containing the signature of the operation. The return value of the operation, or null if the operation returns void. throws: InstanceNotFoundException - If the specified MBean is not registered in the MBeanServer. throws: MBeanException - If the MBean's operation method throws an exception. throws: ReflectionException - If a reflection exception is thrown. throws: IOException - If a communication problem occurred. |
isInstanceOf | public boolean isInstanceOf(ObjectName objectName, String className) throws InstanceNotFoundException, IOException(Code) | | Returns whether the MBean specified is an instance of the specified class.
Parameters: objectName - The ObjectName of the MBean. Parameters: className - The name of the class. True if the MBean specified is an instance of the specified class. throws: InstanceNotFoundException - If the named MBean is not registered in the MBeanServer. throws: IOException - If a communication problem occurred. |
isRegistered | public boolean isRegistered(ObjectName objectName) throws IOException(Code) | | Checks whether the given ObjectName identifies an MBean registered in this MBeanServer.
Parameters: objectName - The ObjectName to be checked. True if an MBean with the specified ObjectName is already registered in the MBeanServer. throws: IOException - If a communication problem occurred. |
queryMBeans | public Set queryMBeans(ObjectName patternName, QueryExp filter) throws IOException(Code) | | Gets a subset of the ObjectInstances belonging to MBeans registered in this MBeanServer.
It is possible to filter the set of MBeans by specifying a pattern for MBean's ObjectNames, and a query expression
to be evaluated to further filter the set of MBeans.
The set can be further restricted if any exception is thrown during retrieval of MBean (for example for
security reasons): the failing MBean will not be included.
Parameters: patternName - The ObjectName pattern identifying the MBeans to be retrieved, or null to retrieve all MBeans. Parameters: filter - The query expression to be evaluated for selecting MBeans, or null. A set containing the ObjectInstance objects for the selected MBeans. throws: IOException - If a communication problem occurred. |
queryNames | public Set queryNames(ObjectName patternName, QueryExp filter) throws IOException(Code) | | Gets a subset of the ObjectNames belonging to MBeans registered in this MBeanServer.
It is possible to filter the set of MBeans by specifying a pattern for MBean's ObjectNames, and a query expression
to be evaluated to further filter the set of MBeans.
The set can be further restricted if any exception is thrown during retrieval of MBean (for example for
security reasons): the failing MBean will not be included.
Parameters: patternName - The ObjectName pattern identifying the MBeans to be retrieved, or null to retrieve all MBeans. Parameters: filter - The query expression to be evaluated for selecting MBeans, or null. A set containing the ObjectNames for the selected MBeans. throws: IOException - If a communication problem occurred. |
removeNotificationListener | public void removeNotificationListener(ObjectName observed, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, ListenerNotFoundException, IOException(Code) | | Removes the specified listener from the named source MBean.
The MBean must have a listener that exactly matches the given listener, filter, and handback parameters.
Parameters: observed - The ObjectName of the source MBean on which the listener should be removed. Parameters: listener - The listener to be removed. Parameters: filter - The filter that was specified when the listener was added. Parameters: handback - The handback that was specified when the listener was added. throws: InstanceNotFoundException - If the source MBean is not registered in the MBeanServer. throws: ListenerNotFoundException - If the listener (along with filter and handback) is not registered in the MBean. throws: IOException - If a communication problem occurred. See Also: MBeanServerConnection.addNotificationListener(ObjectName,NotificationListener,NotificationFilter,Object) since: JMX 1.2 |
removeNotificationListener | public void removeNotificationListener(ObjectName observed, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, ListenerNotFoundException, IOException(Code) | | Removes the specified listener MBean from the named source MBean.
The MBean must have a listener that exactly matches the given listener, filter, and handback parameters.
Parameters: observed - The ObjectName of the source MBean on which the listener should be removed. Parameters: listener - The ObjectName of the listener MBean to be removed. Parameters: filter - The filter that was specified when the listener was added. Parameters: handback - The handback that was specified when the listener was added. throws: InstanceNotFoundException - If the source MBean is not registered in the MBeanServer. throws: ListenerNotFoundException - If the listener (along with filter and handback) is not registered in the MBean. throws: IOException - If a communication problem occurred. See Also: MBeanServerConnection.addNotificationListener(ObjectName,NotificationListener,NotificationFilter,Object) since: JMX 1.2 |
|
|