public abstract class AbstractMBeanServer
extends java.lang.Object
implements javax.management.MBeanServer
| Constructor and Description |
|---|
AbstractMBeanServer(java.lang.String defaultDomain)
Creats a new MBeanServer implementation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addNotificationListener(javax.management.ObjectName name,
javax.management.NotificationListener listener,
javax.management.NotificationFilter filter,
java.lang.Object handback)
Adds a listener to a registered MBean
|
void |
addNotificationListener(javax.management.ObjectName name,
javax.management.ObjectName listenerName,
javax.management.NotificationFilter filter,
java.lang.Object handback)
Adds a listener to a registered MBean
|
protected MBeanContext |
createContext()
Returns the context implementation.
|
protected abstract MBeanContext |
createContext(java.lang.ClassLoader loader)
Returns the context implementation, creating if necessary.
|
javax.management.ObjectInstance |
createMBean(java.lang.String className,
javax.management.ObjectName name)
Instantiate and register an MBean.
|
javax.management.ObjectInstance |
createMBean(java.lang.String className,
javax.management.ObjectName name,
java.lang.Object[] params,
java.lang.String[] signature)
Instantiate and register an MBean.
|
javax.management.ObjectInstance |
createMBean(java.lang.String className,
javax.management.ObjectName name,
javax.management.ObjectName loaderName)
Instantiate and register an MBean.
|
javax.management.ObjectInstance |
createMBean(java.lang.String className,
javax.management.ObjectName name,
javax.management.ObjectName loaderName,
java.lang.Object[] params,
java.lang.String[] signature)
Instantiate and register an MBean.
|
java.io.ObjectInputStream |
deserialize(javax.management.ObjectName name,
byte[] data)
Deserializes a byte array in the class loader of the mbean.
|
java.io.ObjectInputStream |
deserialize(java.lang.String className,
byte[] data)
Deserializes a byte array in the class loader of the mbean.
|
java.io.ObjectInputStream |
deserialize(java.lang.String className,
javax.management.ObjectName loaderName,
byte[] data)
Deserializes a byte array in the class loader of the mbean.
|
void |
destroy()
Handles the case where a class loader is dropped.
|
java.lang.Object |
getAttribute(javax.management.ObjectName name,
java.lang.String attribute)
Returns a specific attribute of a named MBean.
|
javax.management.AttributeList |
getAttributes(javax.management.ObjectName name,
java.lang.String[] attributes)
Returns a list of several MBean attributes.
|
java.lang.ClassLoader |
getClassLoader(javax.management.ObjectName loaderName)
Returns the named ClassLoader.
|
java.lang.ClassLoader |
getClassLoaderFor(javax.management.ObjectName name)
Returns the ClassLoader that was used for loading the MBean.
|
javax.management.loading.ClassLoaderRepository |
getClassLoaderRepository()
Returns the ClassLoaderRepository for this MBeanServer
|
protected abstract MBeanContext |
getContext(java.lang.ClassLoader loader)
Returns the context implementation.
|
protected MBeanContext |
getCurrentContext()
Returns the context implementation.
|
protected abstract MBeanContext |
getCurrentContext(java.lang.ClassLoader loader)
Returns the context implementation.
|
java.lang.String |
getDefaultDomain()
Returns the default domain for naming the MBean
|
java.lang.String[] |
getDomains()
Returns the domains for all registered MBeans
|
protected MBeanContext |
getGlobalContext()
Returns the context implementation.
|
protected MBeanView |
getGlobalView()
Returns the view implementation.
|
java.lang.Integer |
getMBeanCount()
Returns the number of MBeans registered.
|
javax.management.MBeanInfo |
getMBeanInfo(javax.management.ObjectName name)
Returns the analyzed information for an MBean
|
javax.management.ObjectInstance |
getObjectInstance(javax.management.ObjectName name)
Returns the MBean registered with the given name.
|
protected MBeanView |
getParentView()
Returns the view implementation.
|
protected MBeanView |
getView()
Returns the view implementation.
|
java.lang.Object |
instantiate(java.lang.String className)
Instantiate an MBean object to be registered with the server.
|
java.lang.Object |
instantiate(java.lang.String className,
java.lang.Object[] params,
java.lang.String[] signature)
Instantiate an MBean object with the given arguments to be
passed to the constructor.
|
java.lang.Object |
instantiate(java.lang.String className,
javax.management.ObjectName loaderName)
Instantiate an MBean object to be registered with the server.
|
java.lang.Object |
instantiate(java.lang.String className,
javax.management.ObjectName loaderName,
java.lang.Object[] params,
java.lang.String[] signature)
Instantiate an MBean object with the given arguments to be
passed to the constructor.
|
java.lang.Object |
invoke(javax.management.ObjectName name,
java.lang.String operationName,
java.lang.Object[] params,
java.lang.String[] signature)
Invokers an operation on an MBean.
|
boolean |
isInstanceOf(javax.management.ObjectName name,
java.lang.String className)
Returns true if the MBean is an instance of the specified class.
|
boolean |
isRegistered(javax.management.ObjectName name)
Returns true if the given object is registered with the server.
|
java.util.Set<javax.management.ObjectInstance> |
queryMBeans(javax.management.ObjectName name,
javax.management.QueryExp query)
Returns a set of MBeans matching the query.
|
java.util.Set<javax.management.ObjectName> |
queryNames(javax.management.ObjectName name,
javax.management.QueryExp query)
Returns a set of names for MBeans matching the query.
|
javax.management.ObjectInstance |
registerMBean(java.lang.Object object,
javax.management.ObjectName name)
Registers an MBean with the server.
|
protected void |
removeContext(MBeanContext context,
java.lang.ClassLoader loader)
Removes the context implementation.
|
void |
removeNotificationListener(javax.management.ObjectName name,
javax.management.NotificationListener listener)
Removes a listener from a registered MBean
|
void |
removeNotificationListener(javax.management.ObjectName name,
javax.management.NotificationListener listener,
javax.management.NotificationFilter filter,
java.lang.Object handback)
Removes a listener from a registered MBean
|
void |
removeNotificationListener(javax.management.ObjectName name,
javax.management.ObjectName listenerName)
Removes a listener from a registered MBean
|
void |
removeNotificationListener(javax.management.ObjectName name,
javax.management.ObjectName listenerName,
javax.management.NotificationFilter filter,
java.lang.Object handback)
Removes a listener from a registered MBean
|
void |
setAttribute(javax.management.ObjectName name,
javax.management.Attribute attribute)
Sets an attribute in the MBean.
|
javax.management.AttributeList |
setAttributes(javax.management.ObjectName name,
javax.management.AttributeList attributes)
Set an attributes in the MBean.
|
protected abstract void |
setCurrentContext(MBeanContext context,
java.lang.ClassLoader loader)
Sets the context implementation.
|
java.lang.String |
toString()
Returns the string form.
|
void |
unregisterMBean(javax.management.ObjectName name)
Unregisters an MBean from the server.
|
public AbstractMBeanServer(java.lang.String defaultDomain)
protected MBeanContext createContext()
protected final MBeanContext getCurrentContext()
protected final MBeanContext getGlobalContext()
protected abstract MBeanContext createContext(java.lang.ClassLoader loader)
protected abstract MBeanContext getCurrentContext(java.lang.ClassLoader loader)
protected abstract void setCurrentContext(MBeanContext context, java.lang.ClassLoader loader)
protected abstract MBeanContext getContext(java.lang.ClassLoader loader)
protected void removeContext(MBeanContext context, java.lang.ClassLoader loader)
protected MBeanView getView()
protected MBeanView getGlobalView()
protected MBeanView getParentView()
public java.lang.Object instantiate(java.lang.String className)
throws javax.management.ReflectionException,
javax.management.MBeanException
instantiate in interface javax.management.MBeanServerclassName - the className to be instantiated.javax.management.ReflectionExceptionjavax.management.MBeanExceptionpublic java.lang.Object instantiate(java.lang.String className,
javax.management.ObjectName loaderName)
throws javax.management.ReflectionException,
javax.management.MBeanException,
javax.management.InstanceNotFoundException
instantiate in interface javax.management.MBeanServerclassName - the className to be instantiated.loaderName - names the classloader to be usedjavax.management.ReflectionExceptionjavax.management.MBeanExceptionjavax.management.InstanceNotFoundExceptionpublic java.lang.Object instantiate(java.lang.String className,
java.lang.Object[] params,
java.lang.String[] signature)
throws javax.management.ReflectionException,
javax.management.MBeanException
instantiate in interface javax.management.MBeanServerclassName - the className to be instantiated.params - the parameters for the constructor.signature - the signature of the constructorjavax.management.ReflectionExceptionjavax.management.MBeanExceptionpublic java.lang.Object instantiate(java.lang.String className,
javax.management.ObjectName loaderName,
java.lang.Object[] params,
java.lang.String[] signature)
throws javax.management.ReflectionException,
javax.management.MBeanException,
javax.management.InstanceNotFoundException
instantiate in interface javax.management.MBeanServerclassName - the className to be instantiated.loaderName - names the classloader to be usedparams - the parameters for the constructor.signature - the signature of the constructorjavax.management.ReflectionExceptionjavax.management.MBeanExceptionjavax.management.InstanceNotFoundExceptionpublic javax.management.ObjectInstance createMBean(java.lang.String className,
javax.management.ObjectName name)
throws javax.management.ReflectionException,
javax.management.InstanceAlreadyExistsException,
javax.management.MBeanException,
javax.management.NotCompliantMBeanException
createMBean in interface javax.management.MBeanServercreateMBean in interface javax.management.MBeanServerConnectionclassName - the className to be instantiated.name - the name of the mbean.javax.management.ReflectionExceptionjavax.management.InstanceAlreadyExistsExceptionjavax.management.MBeanExceptionjavax.management.NotCompliantMBeanExceptionpublic javax.management.ObjectInstance createMBean(java.lang.String className,
javax.management.ObjectName name,
javax.management.ObjectName loaderName)
throws javax.management.ReflectionException,
javax.management.InstanceAlreadyExistsException,
javax.management.MBeanException,
javax.management.NotCompliantMBeanException,
javax.management.InstanceNotFoundException
createMBean in interface javax.management.MBeanServercreateMBean in interface javax.management.MBeanServerConnectionclassName - the className to be instantiated.name - the name of the mbean.loaderName - the name of the class loader to userjavax.management.ReflectionExceptionjavax.management.InstanceAlreadyExistsExceptionjavax.management.MBeanExceptionjavax.management.NotCompliantMBeanExceptionjavax.management.InstanceNotFoundExceptionpublic javax.management.ObjectInstance createMBean(java.lang.String className,
javax.management.ObjectName name,
java.lang.Object[] params,
java.lang.String[] signature)
throws javax.management.ReflectionException,
javax.management.InstanceAlreadyExistsException,
javax.management.MBeanException,
javax.management.NotCompliantMBeanException
createMBean in interface javax.management.MBeanServercreateMBean in interface javax.management.MBeanServerConnectionclassName - the className to be instantiated.name - the name of the mbean.params - the parameters for the constructor.signature - the signature of the constructorjavax.management.ReflectionExceptionjavax.management.InstanceAlreadyExistsExceptionjavax.management.MBeanExceptionjavax.management.NotCompliantMBeanExceptionpublic javax.management.ObjectInstance createMBean(java.lang.String className,
javax.management.ObjectName name,
javax.management.ObjectName loaderName,
java.lang.Object[] params,
java.lang.String[] signature)
throws javax.management.ReflectionException,
javax.management.InstanceAlreadyExistsException,
javax.management.MBeanException,
javax.management.NotCompliantMBeanException,
javax.management.InstanceNotFoundException
createMBean in interface javax.management.MBeanServercreateMBean in interface javax.management.MBeanServerConnectionclassName - the className to be instantiated.name - the name of the mbean.loaderName - the loader name for the mbean.params - the parameters for the constructor.signature - the signature of the constructorjavax.management.ReflectionExceptionjavax.management.InstanceAlreadyExistsExceptionjavax.management.MBeanExceptionjavax.management.NotCompliantMBeanExceptionjavax.management.InstanceNotFoundExceptionpublic javax.management.ObjectInstance registerMBean(java.lang.Object object,
javax.management.ObjectName name)
throws javax.management.InstanceAlreadyExistsException,
javax.management.MBeanRegistrationException,
javax.management.NotCompliantMBeanException
registerMBean in interface javax.management.MBeanServerobject - the object to be registered as an MBeanname - the name of the mbean.javax.management.InstanceAlreadyExistsExceptionjavax.management.MBeanRegistrationExceptionjavax.management.NotCompliantMBeanExceptionpublic void unregisterMBean(javax.management.ObjectName name)
throws javax.management.InstanceNotFoundException,
javax.management.MBeanRegistrationException
unregisterMBean in interface javax.management.MBeanServerunregisterMBean in interface javax.management.MBeanServerConnectionname - the name of the mbean.javax.management.InstanceNotFoundExceptionjavax.management.MBeanRegistrationExceptionpublic javax.management.ObjectInstance getObjectInstance(javax.management.ObjectName name)
throws javax.management.InstanceNotFoundException
getObjectInstance in interface javax.management.MBeanServergetObjectInstance in interface javax.management.MBeanServerConnectionname - the name of the mbean.javax.management.InstanceNotFoundExceptionpublic java.util.Set<javax.management.ObjectInstance> queryMBeans(javax.management.ObjectName name,
javax.management.QueryExp query)
queryMBeans in interface javax.management.MBeanServerqueryMBeans in interface javax.management.MBeanServerConnectionname - the name of the mbean to match.query - the queryd to match.public java.util.Set<javax.management.ObjectName> queryNames(javax.management.ObjectName name,
javax.management.QueryExp query)
queryNames in interface javax.management.MBeanServerqueryNames in interface javax.management.MBeanServerConnectionname - the name of the mbean to match.query - the query to match.public boolean isRegistered(javax.management.ObjectName name)
isRegistered in interface javax.management.MBeanServerisRegistered in interface javax.management.MBeanServerConnectionname - the name of the mbean to test.public java.lang.Integer getMBeanCount()
getMBeanCount in interface javax.management.MBeanServergetMBeanCount in interface javax.management.MBeanServerConnectionpublic java.lang.Object getAttribute(javax.management.ObjectName name,
java.lang.String attribute)
throws javax.management.MBeanException,
javax.management.AttributeNotFoundException,
javax.management.InstanceNotFoundException,
javax.management.ReflectionException
getAttribute in interface javax.management.MBeanServergetAttribute in interface javax.management.MBeanServerConnectionname - the name of the mbean to testattribute - the name of the attribute to retrievejavax.management.MBeanExceptionjavax.management.AttributeNotFoundExceptionjavax.management.InstanceNotFoundExceptionjavax.management.ReflectionExceptionpublic javax.management.AttributeList getAttributes(javax.management.ObjectName name,
java.lang.String[] attributes)
throws javax.management.InstanceNotFoundException,
javax.management.ReflectionException
getAttributes in interface javax.management.MBeanServergetAttributes in interface javax.management.MBeanServerConnectionname - the name of the mbeanattributes - the name of the attributes to retrievejavax.management.InstanceNotFoundExceptionjavax.management.ReflectionExceptionpublic void setAttribute(javax.management.ObjectName name,
javax.management.Attribute attribute)
throws javax.management.InstanceNotFoundException,
javax.management.AttributeNotFoundException,
javax.management.InvalidAttributeValueException,
javax.management.MBeanException,
javax.management.ReflectionException
setAttribute in interface javax.management.MBeanServersetAttribute in interface javax.management.MBeanServerConnectionname - the name of the mbeanattribute - the name/value of the attribute to set.javax.management.InstanceNotFoundExceptionjavax.management.AttributeNotFoundExceptionjavax.management.InvalidAttributeValueExceptionjavax.management.MBeanExceptionjavax.management.ReflectionExceptionpublic javax.management.AttributeList setAttributes(javax.management.ObjectName name,
javax.management.AttributeList attributes)
throws javax.management.InstanceNotFoundException,
javax.management.ReflectionException
setAttributes in interface javax.management.MBeanServersetAttributes in interface javax.management.MBeanServerConnectionname - the name of the mbeanattributes - the name/value list of the attribute to set.javax.management.InstanceNotFoundExceptionjavax.management.ReflectionExceptionpublic java.lang.Object invoke(javax.management.ObjectName name,
java.lang.String operationName,
java.lang.Object[] params,
java.lang.String[] signature)
throws javax.management.InstanceNotFoundException,
javax.management.MBeanException,
javax.management.ReflectionException
invoke in interface javax.management.MBeanServerinvoke in interface javax.management.MBeanServerConnectionname - the name of the mbeanoperationName - the name of the method to invokeparams - the parameters for the invocationsignature - the signature of the operationjavax.management.InstanceNotFoundExceptionjavax.management.MBeanExceptionjavax.management.ReflectionExceptionpublic java.lang.String getDefaultDomain()
getDefaultDomain in interface javax.management.MBeanServergetDefaultDomain in interface javax.management.MBeanServerConnectionpublic void addNotificationListener(javax.management.ObjectName name,
javax.management.NotificationListener listener,
javax.management.NotificationFilter filter,
java.lang.Object handback)
throws javax.management.InstanceNotFoundException
addNotificationListener in interface javax.management.MBeanServeraddNotificationListener in interface javax.management.MBeanServerConnectionname - the name of the mbeanlistener - the listener objectfilter - filters events the listener is interested inhandback - context to be returned to the listenerjavax.management.InstanceNotFoundExceptionpublic void addNotificationListener(javax.management.ObjectName name,
javax.management.ObjectName listenerName,
javax.management.NotificationFilter filter,
java.lang.Object handback)
throws javax.management.InstanceNotFoundException
addNotificationListener in interface javax.management.MBeanServeraddNotificationListener in interface javax.management.MBeanServerConnectionname - the name of the mbeanlistenerName - the name of the listenerfilter - filters events the listener is interested inhandback - context to be returned to the listenerjavax.management.InstanceNotFoundExceptionpublic void removeNotificationListener(javax.management.ObjectName name,
javax.management.NotificationListener listener)
throws javax.management.InstanceNotFoundException,
javax.management.ListenerNotFoundException
removeNotificationListener in interface javax.management.MBeanServerremoveNotificationListener in interface javax.management.MBeanServerConnectionname - the name of the mbeanlistener - the listener objectjavax.management.InstanceNotFoundExceptionjavax.management.ListenerNotFoundExceptionpublic void removeNotificationListener(javax.management.ObjectName name,
javax.management.ObjectName listenerName)
throws javax.management.InstanceNotFoundException,
javax.management.ListenerNotFoundException
removeNotificationListener in interface javax.management.MBeanServerremoveNotificationListener in interface javax.management.MBeanServerConnectionname - the name of the mbeanlistenerName - the name of the listenerjavax.management.InstanceNotFoundExceptionjavax.management.ListenerNotFoundExceptionpublic void removeNotificationListener(javax.management.ObjectName name,
javax.management.ObjectName listenerName,
javax.management.NotificationFilter filter,
java.lang.Object handback)
throws javax.management.InstanceNotFoundException,
javax.management.ListenerNotFoundException
removeNotificationListener in interface javax.management.MBeanServerremoveNotificationListener in interface javax.management.MBeanServerConnectionname - the name of the mbeanlistenerName - the name of the listenerfilter - the notification filterhandback - context to the listenerjavax.management.InstanceNotFoundExceptionjavax.management.ListenerNotFoundExceptionpublic void removeNotificationListener(javax.management.ObjectName name,
javax.management.NotificationListener listener,
javax.management.NotificationFilter filter,
java.lang.Object handback)
throws javax.management.InstanceNotFoundException,
javax.management.ListenerNotFoundException
removeNotificationListener in interface javax.management.MBeanServerremoveNotificationListener in interface javax.management.MBeanServerConnectionname - the name of the mbeanlistenerName - the name of the listenerfilter - the notification filterhandback - context to the listenerjavax.management.InstanceNotFoundExceptionjavax.management.ListenerNotFoundExceptionpublic javax.management.MBeanInfo getMBeanInfo(javax.management.ObjectName name)
throws javax.management.InstanceNotFoundException,
javax.management.IntrospectionException,
javax.management.ReflectionException
getMBeanInfo in interface javax.management.MBeanServergetMBeanInfo in interface javax.management.MBeanServerConnectionname - the name of the mbeanjavax.management.InstanceNotFoundExceptionjavax.management.IntrospectionExceptionjavax.management.ReflectionExceptionpublic boolean isInstanceOf(javax.management.ObjectName name,
java.lang.String className)
throws javax.management.InstanceNotFoundException
isInstanceOf in interface javax.management.MBeanServerisInstanceOf in interface javax.management.MBeanServerConnectionname - the name of the mbeanclassName - the className to test.javax.management.InstanceNotFoundExceptionpublic java.lang.ClassLoader getClassLoaderFor(javax.management.ObjectName name)
throws javax.management.InstanceNotFoundException
getClassLoaderFor in interface javax.management.MBeanServermbeanName - the name of the mbeanjavax.management.InstanceNotFoundExceptionpublic java.lang.ClassLoader getClassLoader(javax.management.ObjectName loaderName)
throws javax.management.InstanceNotFoundException
getClassLoader in interface javax.management.MBeanServerloaderName - the name of the class loaderjavax.management.InstanceNotFoundExceptionpublic javax.management.loading.ClassLoaderRepository getClassLoaderRepository()
getClassLoaderRepository in interface javax.management.MBeanServerpublic java.io.ObjectInputStream deserialize(javax.management.ObjectName name,
byte[] data)
throws javax.management.InstanceNotFoundException,
javax.management.OperationsException
deserialize in interface javax.management.MBeanServername - the name of the mbeandata - the data to deserializejavax.management.InstanceNotFoundExceptionjavax.management.OperationsExceptionpublic java.io.ObjectInputStream deserialize(java.lang.String className,
byte[] data)
throws javax.management.OperationsException,
javax.management.ReflectionException
deserialize in interface javax.management.MBeanServerclassName - the className matches to the loaderdata - the data to deserializejavax.management.OperationsExceptionjavax.management.ReflectionExceptionpublic java.io.ObjectInputStream deserialize(java.lang.String className,
javax.management.ObjectName loaderName,
byte[] data)
throws javax.management.OperationsException,
javax.management.ReflectionException,
javax.management.InstanceNotFoundException
deserialize in interface javax.management.MBeanServerclassName - the className matches to the loaderloaderName - the loader to use for deserializationdata - the data to deserializejavax.management.OperationsExceptionjavax.management.ReflectionExceptionjavax.management.InstanceNotFoundExceptionpublic java.lang.String[] getDomains()
getDomains in interface javax.management.MBeanServergetDomains in interface javax.management.MBeanServerConnectionpublic void destroy()
public java.lang.String toString()
toString in class java.lang.Object