Interface: javax.management.MBeanServerConnection
- public interface MBeanServerConnection
Methods
-
addNotificationListenertop
public void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, IOExceptionAdds a listener to a registered MBean.
A notification emitted by an MBean will be forwarded by the MBeanServer to the listener. If the source of the notification is a reference to an MBean object, the MBean server will replace it by that MBean's ObjectName. Otherwise the source is unchanged.
-
addNotificationListenertop
public void addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, IOExceptionAdds a listener to a registered MBean.
A notification emitted by an MBean will be forwarded by the MBeanServer to the listener. If the source of the notification is a reference to an MBean object, the MBean server will replace it by that 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.
-
createMBeantop
public ObjectInstance createMBean(String className, ObjectName name) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, IOExceptionInstantiates and registers an MBean in the MBean server. The MBean server will use its 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 must provide its own name by implementing the MBeanRegistration interface and returning the name from the preRegister method.
This method is equivalent to createMBean(className, name, (Object[]) null, (String[]) null).
-
createMBeantop
public ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException, IOExceptionInstantiates 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 must provide its own name by implementing the MBeanRegistration interface and returning the name from the preRegister method.
This method is equivalent to createMBean(className, name, loaderName, (Object[]) null, (String[]) null).
-
createMBeantop
public ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException, IOExceptionInstantiates 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 must provide its own name by implementing the MBeanRegistration interface and returning the name from the preRegister method. -
createMBeantop
public ObjectInstance createMBean(String className, ObjectName name, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, IOExceptionInstantiates and registers an MBean in the MBean server. The MBean server will use its 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 must provide its own name by implementing the MBeanRegistration interface and returning the name from the preRegister method. -
getAttributetop
public Object getAttribute(ObjectName name, String attribute) throws MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException, IOExceptionGets the value of a specific attribute of a named MBean. The MBean is identified by its object name. -
getAttributestop
public AttributeList getAttributes(ObjectName name, String[] attributes) throws InstanceNotFoundException, ReflectionException, IOExceptionEnables the values of several attributes of a named MBean. The MBean is identified by its object name. -
getDefaultDomaintop
public String getDefaultDomain() throws IOExceptionReturns 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. -
getDomainstop
public String[] getDomains() throws IOExceptionReturns the list of domains in which any MBean is currently registered. A string is in the returned array if and only if there is at least one MBean registered with an ObjectName whose getDomain() is equal to that string. The order of strings within the returned array is not defined.
-
getMBeanCounttop
public Integer getMBeanCount() throws IOExceptionReturns the number of MBeans registered in the MBean server. -
getMBeanInfotop
public MBeanInfo getMBeanInfo(ObjectName name) throws InstanceNotFoundException, IntrospectionException, ReflectionException, IOExceptionThis method discovers the attributes and operations that an MBean exposes for management. -
getObjectInstancetop
public ObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException, IOExceptionGets theObjectInstancefor a given MBean registered with the MBean server. -
invoketop
public Object invoke(ObjectName name, String operationName, Object[] params, String[] signature) throws InstanceNotFoundException, MBeanException, ReflectionException, IOExceptionInvokes an operation on an MBean. -
isInstanceOftop
public boolean isInstanceOf(ObjectName name, String className) throws InstanceNotFoundException, IOExceptionReturns true if the MBean specified is an instance of the specified class, false otherwise.
If
namedoes not name an MBean, this method throws javax.management.InstanceNotFoundException.Otherwise, let
X be the MBean named byname,
L be the ClassLoader of X,
N be the class name in X's javax.management.MBeanInfo.If N equals
className, the result is true.Otherwise, if L successfully loads
classNameand X is an instance of this class, the result is true.Otherwise, if L successfully loads both N and
className, and the second class is assignable from the first, the result is true.Otherwise, the result is false.
-
isRegisteredtop
public boolean isRegistered(ObjectName name) throws IOExceptionChecks whether an MBean, identified by its object name, is already registered with the MBean server. -
queryMBeanstop
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 theObjectNameand/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 ofObjectInstanceobjects (containing theObjectNameand the Java Class name) for the selected MBeans. -
queryNamestop
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 theObjectNameand/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. -
removeNotificationListenertop
public void removeNotificationListener(ObjectName name, NotificationListener listener) throws InstanceNotFoundException, ListenerNotFoundException, IOExceptionRemoves 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.
-
removeNotificationListenertop
public void removeNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, ListenerNotFoundException, IOExceptionRemoves a listener from a registered MBean.
The MBean must have a listener that exactly matches the given
listener,filter, andhandbackparameters. If there is more than one such listener, only one is removed.The
filterandhandbackparameters may be null if and only if they are null in a listener to be removed. -
removeNotificationListenertop
public void removeNotificationListener(ObjectName name, ObjectName listener) throws InstanceNotFoundException, ListenerNotFoundException, IOExceptionRemoves 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.
-
removeNotificationListenertop
public void removeNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, ListenerNotFoundException, IOExceptionRemoves a listener from a registered MBean.
The MBean must have a listener that exactly matches the given
listener,filter, andhandbackparameters. If there is more than one such listener, only one is removed.The
filterandhandbackparameters may be null if and only if they are null in a listener to be removed. -
setAttributetop
public void setAttribute(ObjectName name, Attribute attribute) throws InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException, IOExceptionSets the value of a specific attribute of a named MBean. The MBean is identified by its object name. -
setAttributestop
public AttributeList setAttributes(ObjectName name, AttributeList attributes) throws InstanceNotFoundException, ReflectionException, IOExceptionSets the values of several attributes of a named MBean. The MBean is identified by its object name. -
unregisterMBeantop
public void unregisterMBean(ObjectName name) throws InstanceNotFoundException, MBeanRegistrationException, IOExceptionUnregisters an MBean from the MBean server. The MBean is identified by its object name. Once the method has been invoked, the MBean may no longer be accessed by its object name.
