|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MBeanServer
The interface used to access the MBean server instances.
MBeanServerFactory
,
ClassLoaderRepository
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. |
ObjectInputStream |
deserialize(ObjectName name,
byte[] data)
Deprecated. use getClassLoaderFor(ObjectName) to obtain the
appropriate classloader for deserialization |
ObjectInputStream |
deserialize(String className,
byte[] data)
Deprecated. use getClassLoaderFor(ObjectName) to obtain the
appropriate classloader for deserialization |
ObjectInputStream |
deserialize(String className,
ObjectName loaderName,
byte[] data)
Deprecated. use getClassLoaderFor(ObjectName) to obtain the
appropriate classloader for deserialization |
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. |
ClassLoader |
getClassLoader(ObjectName name)
Retrieve the classloader registered as an MBean |
ClassLoader |
getClassLoaderFor(ObjectName name)
Retrieve the classloader for an mbean |
ClassLoaderRepository |
getClassLoaderRepository()
Retrieve the classloader repository for this mbean server |
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 |
instantiate(String className)
Instantiates an object using the default loader repository and default no-args constructor. |
Object |
instantiate(String className,
Object[] params,
String[] signature)
Instantiates an object using the default loader repository and a given constructor. |
Object |
instantiate(String className,
ObjectName loaderName)
Instantiates an object using the given class loader. |
Object |
instantiate(String className,
ObjectName loaderName,
Object[] params,
String[] signature)
Instantiates an object using the given class loader. |
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 |
ObjectInstance |
registerMBean(Object object,
ObjectName name)
Registers an mbean. |
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 |
---|
ObjectInstance createMBean(String className, ObjectName name) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException
Uses the default contructor.
createMBean
in interface MBeanServerConnection
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 patternObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException
The MBean is loaded using the passed classloader. Uses the default contructor.
createMBean
in interface MBeanServerConnection
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 patternObjectInstance createMBean(String className, ObjectName name, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException
Uses the specified constructor.
createMBean
in interface MBeanServerConnection
className
- the class name of the mbeanloaderName
- an MBean that implements a classloaderparams
- 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 patternObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException
The MBean is loaded using the passed classloader. Uses the specified constructor.
createMBean
in interface MBeanServerConnection
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 patternObjectInstance registerMBean(Object object, ObjectName name) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException
object
- the mbean implementation to registername
- the object name of the mbean to register
InstanceAlreadyExistsException
- if the object name is already registered
in the MBeanServer
MBeanRegistrationException
- for any exception thrown by the
MBean's preDeregister
NotCompliantMBeanException
- if the class name does not correspond to
a valid MBean
RuntimeOperationsException
- wrapping an IllegalArgumentException for a
null name, or trying to register a JMX implementation MBeanvoid unregisterMBean(ObjectName name) throws InstanceNotFoundException, MBeanRegistrationException
unregisterMBean
in interface MBeanServerConnection
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 MBeanObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException
getObjectInstance
in interface MBeanServerConnection
name
- the object name of the mbean
InstanceNotFoundException
- if the mbean is not registered
in the MBeanServerSet queryMBeans(ObjectName name, QueryExp query)
queryMBeans
in interface MBeanServerConnection
name
- an ObjectName pattern, can be null for all mbeansquery
- a query expression to further filter the mbeans, can be null
for no querySet queryNames(ObjectName name, QueryExp query)
queryNames
in interface MBeanServerConnection
name
- an ObjectName pattern, can be null for all mbeansquery
- a query expression to further filter the mbeans, can be null
for no queryboolean isRegistered(ObjectName name)
isRegistered
in interface MBeanServerConnection
name
- the object name of the mbean
RuntimeOperationsException
- wrapping an IllegalArgumentException for a
null nameInteger getMBeanCount()
getMBeanCount
in interface MBeanServerConnection
Object getAttribute(ObjectName name, String attribute) throws MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException
getAttribute
in interface MBeanServerConnection
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 attributeAttributeList getAttributes(ObjectName name, String[] attributes) throws InstanceNotFoundException, ReflectionException
getAttributes
in interface MBeanServerConnection
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 attributesvoid setAttribute(ObjectName name, Attribute attribute) throws InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException
setAttribute
in interface MBeanServerConnection
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 attributeAttributeList setAttributes(ObjectName name, AttributeList attributes) throws InstanceNotFoundException, ReflectionException
setAttributes
in interface MBeanServerConnection
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 attributesObject invoke(ObjectName name, String operationName, Object[] params, String[] signature) throws InstanceNotFoundException, MBeanException, ReflectionException
invoke
in interface MBeanServerConnection
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 registeredString getDefaultDomain()
getDefaultDomain
in interface MBeanServerConnection
String[] getDomains()
getDomains
in interface MBeanServerConnection
void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException
addNotificationListener
in interface MBeanServerConnection
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 registeredvoid addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException
addNotificationListener
in interface MBeanServerConnection
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 interfacevoid removeNotificationListener(ObjectName name, ObjectName listener) throws InstanceNotFoundException, ListenerNotFoundException
All registrations of the listener are removed.
removeNotificationListener
in interface MBeanServerConnection
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 broadcastervoid removeNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, ListenerNotFoundException
Only the listener that was registered with the same filter and handback is removed.
removeNotificationListener
in interface MBeanServerConnection
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 broadcastervoid removeNotificationListener(ObjectName name, NotificationListener listener) throws InstanceNotFoundException, ListenerNotFoundException
All registrations of the listener are removed.
removeNotificationListener
in interface MBeanServerConnection
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 broadcastervoid removeNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, ListenerNotFoundException
Only the listener that was registered with the same filter and handback is removed.
removeNotificationListener
in interface MBeanServerConnection
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 broadcasterMBeanInfo getMBeanInfo(ObjectName name) throws InstanceNotFoundException, IntrospectionException, ReflectionException
getMBeanInfo
in interface MBeanServerConnection
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 mbeanboolean isInstanceOf(ObjectName name, String className) throws InstanceNotFoundException
isInstanceOf
in interface MBeanServerConnection
name
- the name of the mbeanclassName
- the class name to check
InstanceNotFoundException
- if the mbean is not registeredObject instantiate(String className) throws ReflectionException, MBeanException
className
- Class to instantiate. Must have a public no-args
constructor. Cannot contain a null reference.
ReflectionException
- 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
- If the object constructor threw a checked exception
during the initialization. This exception wraps the actual
exception thrown.
RuntimeMBeanException
- If the class constructor threw a runtime
exception. This exception wraps the actual exception thrown.
RuntimeErrorException
- If the class constructor threw an error.
This exception wraps the actual error thrown.
RuntimeOperationsException
- If the className is null.
Wraps an IllegalArgumentException instance.DefaultLoaderRepository
Object instantiate(String className, ObjectName loaderName) throws ReflectionException, MBeanException, InstanceNotFoundException
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.
ReflectionException
- 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
- If the object constructor threw a checked exception
during the initialization. This exception wraps the actual exception
thrown.
InstanceNotFoundException
- if the specified class loader was not
registered to the agent
RuntimeMBeanException
- If the class constructor raised a runtime
exception. This exception wraps the actual exception thrown.
RuntimeErrorException
- If the class constructor raised an error.
This exception wraps the actual error thrown.
RuntimeOperationsException
- if the className is null.
Wraps an IllegalArgumentException instance.Object instantiate(String className, Object[] params, String[] signature) throws ReflectionException, MBeanException
className
- class to instantiateparams
- argument values for the constructor callsignature
- signature of the constructor as fully qualified class names
ReflectionException
- 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
- If the object constructor raised a checked exception
during the initialization. This exception wraps the actual exception
thrown.
RuntimeMBeanException
- If the class constructor raised a runtime
exception. This exception wraps the actual exception thrown.
RuntimeErrorException
- If the class constructor raised an error.
This exception wraps the actual error thrown.
RuntimeOperationsException
- if the className is null.
Wraps an IllegalArgumentException instance.DefaultLoaderRepository
Object instantiate(String className, ObjectName loaderName, Object[] params, String[] signature) throws ReflectionException, MBeanException, InstanceNotFoundException
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
ReflectionException
- 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
- If the object constructor raised a checked exception
during the initialization. This exception wraps the actual exception thrown.
InstanceNotFoundException
- if the specified class loader was not
registered to the agent.
RuntimeMBeanException
- If the class constructor raised a runtime
exception. This exception wraps the actual exception thrown.
RuntimeErrorException
- If the class constructor raised an error.
This exception wraps the actual error thrown.
RuntimeOperationsException
- if the className argument is null.
Wraps an IllegalArgumentException instance.ObjectInputStream deserialize(ObjectName name, byte[] data) throws InstanceNotFoundException, OperationsException
getClassLoaderFor(ObjectName)
to obtain the
appropriate classloader for deserialization
InstanceNotFoundException
OperationsException
ObjectInputStream deserialize(String className, byte[] data) throws OperationsException, ReflectionException
getClassLoaderFor(ObjectName)
to obtain the
appropriate classloader for deserialization
OperationsException
ReflectionException
ObjectInputStream deserialize(String className, ObjectName loaderName, byte[] data) throws InstanceNotFoundException, OperationsException, ReflectionException
getClassLoaderFor(ObjectName)
to obtain the
appropriate classloader for deserialization
InstanceNotFoundException
OperationsException
ReflectionException
ClassLoader getClassLoaderFor(ObjectName name) throws InstanceNotFoundException
name
- the object name of the mbean
InstanceNotFoundException
- when the mbean is not registeredClassLoader getClassLoader(ObjectName name) throws InstanceNotFoundException
name
- the object name of the classloader
InstanceNotFoundException
- when the mbean is not registeredClassLoaderRepository getClassLoaderRepository()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |