|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface used to talk to an MBeanServer that is either remote or local. The local interface MBeanServer extends this one.
MBeanServer
Method Summary | |
void |
addNotificationListener(ObjectName name,
NotificationListener listener,
NotificationFilter filter,
Object handback)
Add a notification listener to an MBean. |
void |
addNotificationListener(ObjectName name,
ObjectName listener,
NotificationFilter filter,
Object handback)
Add a notification listener to an MBean. |
ObjectInstance |
createMBean(String className,
ObjectName name)
Create an MBean registered using the given object name. |
ObjectInstance |
createMBean(String className,
ObjectName name,
Object[] params,
String[] signature)
Create an MBean registered using the given object name. |
ObjectInstance |
createMBean(String className,
ObjectName name,
ObjectName loaderName)
Create an MBean registered using the given object name. |
ObjectInstance |
createMBean(String className,
ObjectName name,
ObjectName loaderName,
Object[] params,
String[] signature)
Create an MBean registered using the given object name. |
Object |
getAttribute(ObjectName name,
String attribute)
Retrieve a value from an MBean. |
AttributeList |
getAttributes(ObjectName name,
String[] attributes)
Retrieve a list of values from an MBean. |
String |
getDefaultDomain()
Retrieve the default domain of the mbeanserver. |
String[] |
getDomains()
Retrieve the domains of the mbeanserver. |
Integer |
getMBeanCount()
Retrieve the number of mbeans registered in the server. |
MBeanInfo |
getMBeanInfo(ObjectName name)
Retrieves the jmx metadata for an mbean |
ObjectInstance |
getObjectInstance(ObjectName name)
Retrieve an MBean's registration information. |
Object |
invoke(ObjectName name,
String operationName,
Object[] params,
String[] signature)
Invokes an operation on an mbean. |
boolean |
isInstanceOf(ObjectName name,
String className)
Tests whether an mbean can be cast to the given type |
boolean |
isRegistered(ObjectName name)
Test whether an mbean is registered. |
Set |
queryMBeans(ObjectName name,
QueryExp query)
Retrieve a set of Object instances |
Set |
queryNames(ObjectName name,
QueryExp query)
Retrieve a set of Object names |
void |
removeNotificationListener(ObjectName name,
NotificationListener listener)
Removes a listener from an mbean. |
void |
removeNotificationListener(ObjectName name,
NotificationListener listener,
NotificationFilter filter,
Object handback)
Removes a listener from an mbean. |
void |
removeNotificationListener(ObjectName name,
ObjectName listener)
Removes a listener from an mbean. |
void |
removeNotificationListener(ObjectName name,
ObjectName listener,
NotificationFilter filter,
Object handback)
Removes a listener from an mbean. |
void |
setAttribute(ObjectName name,
Attribute attribute)
Set a value for an MBean. |
AttributeList |
setAttributes(ObjectName name,
AttributeList attributes)
Set a list of values for an MBean. |
void |
unregisterMBean(ObjectName name)
Unregisters an mbean. |
Method Detail |
public ObjectInstance createMBean(String className, ObjectName name) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, IOException
Uses the default contructor.
className
- the class name of the mbeanname
- the object name for registration, can be null
ReflectionException
- for class not found or an exception
invoking the contructor
InstanceAlreadyExistsException
- for an MBean already registered
with the passed or generated ObjectName
MBeanRegistrationException
- for any exception thrown by the
MBean's preRegister
MBeanException
- for any exception thrown by the MBean's constructor
NotCompliantMBeanException
- if the class name does not correspond to
a valid MBean
RuntimeOperationsException
- wrapping an IllegalArgumentException for a
null class name, the ObjectName could not be determined or it is a pattern
IOException
- for a communication problem during this operationpublic ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException, IOException
The MBean is loaded using the passed classloader. Uses the default contructor.
className
- the class name of the mbeanloaderName
- an MBean that implements a classloadername
- the object name for registration, can be null
ReflectionException
- for class not found or an exception
invoking the contructor
InstanceAlreadyExistsException
- for an MBean already registered
with the passed or generated ObjectName
MBeanRegistrationException
- for any exception thrown by the
MBean's preRegister
MBeanException
- for any exception thrown by the MBean's constructor
InstanceNotFoundException
- if the loaderName is not a classloader registered
in the MBeanServer
NotCompliantMBeanException
- if the class name does not correspond to
a valid MBean
RuntimeOperationsException
- wrapping an IllegalArgumentException for a
null class name, the ObjectName could not be determined or it is a pattern
IOException
- for a communication problem during this operationpublic ObjectInstance createMBean(String className, ObjectName name, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, IOException
Uses the specified constructor.
className
- the class name of the mbeanname
- the object name for registration, can be nullparams
- the parameters for the constructorsignature
- the signature of the constructor
ReflectionException
- for class not found or an exception
invoking the contructor
InstanceAlreadyExistsException
- for an MBean already registered
with the passed or generated ObjectName
MBeanRegistrationException
- for any exception thrown by the
MBean's preRegister
MBeanException
- for any exception thrown by the MBean's constructor
NotCompliantMBeanException
- if the class name does not correspond to
a valid MBean
RuntimeOperationsException
- wrapping an IllegalArgumentException for a
null class name, the ObjectName could not be determined or it is a pattern
IOException
- for a communication problem during this operationpublic ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException, IOException
The MBean is loaded using the passed classloader. Uses the specified constructor.
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
ReflectionException
- for class not found or an exception
invoking the contructor
InstanceAlreadyExistsException
- for an MBean already registered
with the passed or generated ObjectName
MBeanRegistrationException
- for any exception thrown by the
MBean's preRegister
MBeanException
- for any exception thrown by the MBean's constructor
InstanceNotFoundException
- if the loaderName is not a classloader registered
in the MBeanServer
NotCompliantMBeanException
- if the class name does not correspond to
a valid MBean
RuntimeOperationsException
- wrapping an IllegalArgumentException for a
null class name, the ObjectName could not be determined or it is a pattern
IOException
- for a communication problem during this operationpublic void unregisterMBean(ObjectName name) throws InstanceNotFoundException, MBeanRegistrationException, IOException
name
- the object name of the mbean to unregister
InstanceNotFoundException
- if the mbean is not registered
in the MBeanServer
MBeanRegistrationException
- for any exception thrown by the
MBean's preDeregister
RuntimeOperationsException
- wrapping an IllegalArgumentException for a
null name, or trying to unregister a JMX implementation MBean
IOException
- for a communication problem during this operationpublic ObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException, IOException
name
- the object name of the mbean
InstanceNotFoundException
- if the mbean is not registered
in the MBeanServer
IOException
- for a communication problem during this operationpublic Set queryMBeans(ObjectName name, QueryExp query) throws IOException
name
- an ObjectName pattern, can be null for all mbeansquery
- a query expression to further filter the mbeans, can be null
for no query
IOException
- for a communication problem during this operationpublic Set queryNames(ObjectName name, QueryExp query) throws IOException
name
- an ObjectName pattern, can be null for all mbeansquery
- a query expression to further filter the mbeans, can be null
for no query
IOException
- for a communication problem during this operationpublic boolean isRegistered(ObjectName name) throws IOException
name
- the object name of the mbean
RuntimeOperationsException
- wrapping an IllegalArgumentException for a
null name
IOException
- for a communication problem during this operationpublic Integer getMBeanCount() throws IOException
IOException
- for a communication problem during this operationpublic Object getAttribute(ObjectName name, String attribute) throws MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException, IOException
name
- the object name of the mbeanattribute
- the attribute name of the value to retrieve
ReflectionException
- for an exception invoking the mbean
MBeanException
- for any exception thrown by the mbean
InstanceNotFoundException
- if the mbean is not registered
AttributeNotFoundException
- if the mbean has no such attribute
RuntimeOperationsException
- wrapping an IllegalArgumentException for a
null name or attribute
IOException
- for a communication problem during this operationpublic AttributeList getAttributes(ObjectName name, String[] attributes) throws InstanceNotFoundException, ReflectionException, IOException
name
- the object name of the mbeanattributes
- the attribute names of the values to retrieve
ReflectionException
- for an exception invoking the mbean
InstanceNotFoundException
- if the mbean is not registered
RuntimeOperationsException
- wrapping an IllegalArgumentException for a
null name or attributes
IOException
- for a communication problem during this operationpublic void setAttribute(ObjectName name, Attribute attribute) throws InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException, IOException
name
- the object name of the mbeanattribute
- the attribute name and value to set
ReflectionException
- for an exception invoking the mbean
MBeanException
- for any exception thrown by the mbean
InstanceNotFoundException
- if the mbean is not registered
AttributeNotFoundException
- if the mbean has no such attribute
InvalidAttributeValueException
- if the new value has an incorrect type
RuntimeOperationsException
- wrapping an IllegalArgumentException for a
null name or attribute
IOException
- for a communication problem during this operationpublic AttributeList setAttributes(ObjectName name, AttributeList attributes) throws InstanceNotFoundException, ReflectionException, IOException
name
- the object name of the mbeanattributes
- the attribute names and values to set
ReflectionException
- for an exception invoking the mbean
InstanceNotFoundException
- if the mbean is not registered
RuntimeOperationsException
- wrapping an IllegalArgumentException for a
null name or attributes
IOException
- for a communication problem during this operationpublic Object invoke(ObjectName name, String operationName, Object[] params, String[] signature) throws InstanceNotFoundException, MBeanException, ReflectionException, IOException
name
- the object name of the mbeanoperationName
- the operation to performparams
- the parameterssignature
- the signature of the operation
ReflectionException
- for an exception invoking the mbean
MBeanException
- for any exception thrown by the mbean
InstanceNotFoundException
- if the mbean is not registered
IOException
- for a communication problem during this operationpublic String getDefaultDomain() throws IOException
IOException
- for a communication problem during this operationpublic String[] getDomains() throws IOException
IOException
- for a communication problem during this operationpublic void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, IOException
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
- if the broadcaster is not registered
IOException
- for a communication problem during this operationpublic void addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, IOException
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
- if the broadcaster or listener is not registered
RuntimeOperationsException
- wrapping an IllegalArgumentException for a
null listener or the listener does not implement the Notification Listener interface
IOException
- for a communication problem during this operationpublic void removeNotificationListener(ObjectName name, ObjectName listener) throws InstanceNotFoundException, ListenerNotFoundException, IOException
All registrations of the listener are removed.
name
- the name of the MBean broadcasting notificationslistener
- the object name of the listener to remove
InstanceNotFoundException
- if the broadcaster or listener is not registered
ListenerNotFoundException
- if the listener is not registered against the broadcaster
IOException
- for a communication problem during this operationpublic void removeNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, ListenerNotFoundException, IOException
Only the listener that was registered with the same filter and handback is removed.
name
- the name of the MBean broadcasting notificationslistener
- the object name of listener to removefilter
- the filter of the listener to remove
InstanceNotFoundException
- if the broadcaster or listener is not registered
ListenerNotFoundException
- if the listener, filter, handback
is not registered against the broadcaster
IOException
- for a communication problem during this operationpublic void removeNotificationListener(ObjectName name, NotificationListener listener) throws InstanceNotFoundException, ListenerNotFoundException, IOException
All registrations of the listener are removed.
name
- the name of the MBean broadcasting notificationslistener
- the listener to remove
InstanceNotFoundException
- if the broadcaster is not registered
ListenerNotFoundException
- if the listener is not registered against the broadcaster
IOException
- for a communication problem during this operationpublic void removeNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, ListenerNotFoundException, IOException
Only the listener that was registered with the same filter and handback is removed.
name
- the name of the MBean broadcasting notificationslistener
- the listener to removefilter
- the filter of the listener to remove
InstanceNotFoundException
- if the broadcaster is not registered
ListenerNotFoundException
- if the listener, filter, handback
is not registered against the broadcaster
IOException
- for a communication problem during this operationpublic MBeanInfo getMBeanInfo(ObjectName name) throws InstanceNotFoundException, IntrospectionException, ReflectionException, IOException
name
- the name of the mbean
IntrospectionException
- for any error during instrospection
InstanceNotFoundException
- if the mbean is not registered
ReflectionException
- for any error trying to invoke the operation on the mbean
IOException
- for a communication problem during this operationpublic boolean isInstanceOf(ObjectName name, String className) throws InstanceNotFoundException, IOException
name
- the name of the mbeanclassName
- the class name to check
InstanceNotFoundException
- if the mbean is not registered
IOException
- for a communication problem during this operation
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |