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.MBeanServer
className
- the className to be instantiated.javax.management.ReflectionException
javax.management.MBeanException
public 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.MBeanServer
className
- the className to be instantiated.loaderName
- names the classloader to be usedjavax.management.ReflectionException
javax.management.MBeanException
javax.management.InstanceNotFoundException
public 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.MBeanServer
className
- the className to be instantiated.params
- the parameters for the constructor.signature
- the signature of the constructorjavax.management.ReflectionException
javax.management.MBeanException
public 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.MBeanServer
className
- the className to be instantiated.loaderName
- names the classloader to be usedparams
- the parameters for the constructor.signature
- the signature of the constructorjavax.management.ReflectionException
javax.management.MBeanException
javax.management.InstanceNotFoundException
public 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.MBeanServer
createMBean
in interface javax.management.MBeanServerConnection
className
- the className to be instantiated.name
- the name of the mbean.javax.management.ReflectionException
javax.management.InstanceAlreadyExistsException
javax.management.MBeanException
javax.management.NotCompliantMBeanException
public 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.MBeanServer
createMBean
in interface javax.management.MBeanServerConnection
className
- the className to be instantiated.name
- the name of the mbean.loaderName
- the name of the class loader to userjavax.management.ReflectionException
javax.management.InstanceAlreadyExistsException
javax.management.MBeanException
javax.management.NotCompliantMBeanException
javax.management.InstanceNotFoundException
public 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.MBeanServer
createMBean
in interface javax.management.MBeanServerConnection
className
- the className to be instantiated.name
- the name of the mbean.params
- the parameters for the constructor.signature
- the signature of the constructorjavax.management.ReflectionException
javax.management.InstanceAlreadyExistsException
javax.management.MBeanException
javax.management.NotCompliantMBeanException
public 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.MBeanServer
createMBean
in interface javax.management.MBeanServerConnection
className
- 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.ReflectionException
javax.management.InstanceAlreadyExistsException
javax.management.MBeanException
javax.management.NotCompliantMBeanException
javax.management.InstanceNotFoundException
public 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.MBeanServer
object
- the object to be registered as an MBeanname
- the name of the mbean.javax.management.InstanceAlreadyExistsException
javax.management.MBeanRegistrationException
javax.management.NotCompliantMBeanException
public void unregisterMBean(javax.management.ObjectName name) throws javax.management.InstanceNotFoundException, javax.management.MBeanRegistrationException
unregisterMBean
in interface javax.management.MBeanServer
unregisterMBean
in interface javax.management.MBeanServerConnection
name
- the name of the mbean.javax.management.InstanceNotFoundException
javax.management.MBeanRegistrationException
public javax.management.ObjectInstance getObjectInstance(javax.management.ObjectName name) throws javax.management.InstanceNotFoundException
getObjectInstance
in interface javax.management.MBeanServer
getObjectInstance
in interface javax.management.MBeanServerConnection
name
- the name of the mbean.javax.management.InstanceNotFoundException
public java.util.Set<javax.management.ObjectInstance> queryMBeans(javax.management.ObjectName name, javax.management.QueryExp query)
queryMBeans
in interface javax.management.MBeanServer
queryMBeans
in interface javax.management.MBeanServerConnection
name
- 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.MBeanServer
queryNames
in interface javax.management.MBeanServerConnection
name
- the name of the mbean to match.query
- the query to match.public boolean isRegistered(javax.management.ObjectName name)
isRegistered
in interface javax.management.MBeanServer
isRegistered
in interface javax.management.MBeanServerConnection
name
- the name of the mbean to test.public java.lang.Integer getMBeanCount()
getMBeanCount
in interface javax.management.MBeanServer
getMBeanCount
in interface javax.management.MBeanServerConnection
public 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.MBeanServer
getAttribute
in interface javax.management.MBeanServerConnection
name
- the name of the mbean to testattribute
- the name of the attribute to retrievejavax.management.MBeanException
javax.management.AttributeNotFoundException
javax.management.InstanceNotFoundException
javax.management.ReflectionException
public javax.management.AttributeList getAttributes(javax.management.ObjectName name, java.lang.String[] attributes) throws javax.management.InstanceNotFoundException, javax.management.ReflectionException
getAttributes
in interface javax.management.MBeanServer
getAttributes
in interface javax.management.MBeanServerConnection
name
- the name of the mbeanattributes
- the name of the attributes to retrievejavax.management.InstanceNotFoundException
javax.management.ReflectionException
public 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.MBeanServer
setAttribute
in interface javax.management.MBeanServerConnection
name
- the name of the mbeanattribute
- the name/value of the attribute to set.javax.management.InstanceNotFoundException
javax.management.AttributeNotFoundException
javax.management.InvalidAttributeValueException
javax.management.MBeanException
javax.management.ReflectionException
public javax.management.AttributeList setAttributes(javax.management.ObjectName name, javax.management.AttributeList attributes) throws javax.management.InstanceNotFoundException, javax.management.ReflectionException
setAttributes
in interface javax.management.MBeanServer
setAttributes
in interface javax.management.MBeanServerConnection
name
- the name of the mbeanattributes
- the name/value list of the attribute to set.javax.management.InstanceNotFoundException
javax.management.ReflectionException
public 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.MBeanServer
invoke
in interface javax.management.MBeanServerConnection
name
- the name of the mbeanoperationName
- the name of the method to invokeparams
- the parameters for the invocationsignature
- the signature of the operationjavax.management.InstanceNotFoundException
javax.management.MBeanException
javax.management.ReflectionException
public java.lang.String getDefaultDomain()
getDefaultDomain
in interface javax.management.MBeanServer
getDefaultDomain
in interface javax.management.MBeanServerConnection
public 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.MBeanServer
addNotificationListener
in interface javax.management.MBeanServerConnection
name
- the name of the mbeanlistener
- the listener objectfilter
- filters events the listener is interested inhandback
- context to be returned to the listenerjavax.management.InstanceNotFoundException
public 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.MBeanServer
addNotificationListener
in interface javax.management.MBeanServerConnection
name
- 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.InstanceNotFoundException
public void removeNotificationListener(javax.management.ObjectName name, javax.management.NotificationListener listener) throws javax.management.InstanceNotFoundException, javax.management.ListenerNotFoundException
removeNotificationListener
in interface javax.management.MBeanServer
removeNotificationListener
in interface javax.management.MBeanServerConnection
name
- the name of the mbeanlistener
- the listener objectjavax.management.InstanceNotFoundException
javax.management.ListenerNotFoundException
public void removeNotificationListener(javax.management.ObjectName name, javax.management.ObjectName listenerName) throws javax.management.InstanceNotFoundException, javax.management.ListenerNotFoundException
removeNotificationListener
in interface javax.management.MBeanServer
removeNotificationListener
in interface javax.management.MBeanServerConnection
name
- the name of the mbeanlistenerName
- the name of the listenerjavax.management.InstanceNotFoundException
javax.management.ListenerNotFoundException
public 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.MBeanServer
removeNotificationListener
in interface javax.management.MBeanServerConnection
name
- the name of the mbeanlistenerName
- the name of the listenerfilter
- the notification filterhandback
- context to the listenerjavax.management.InstanceNotFoundException
javax.management.ListenerNotFoundException
public 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.MBeanServer
removeNotificationListener
in interface javax.management.MBeanServerConnection
name
- the name of the mbeanlistenerName
- the name of the listenerfilter
- the notification filterhandback
- context to the listenerjavax.management.InstanceNotFoundException
javax.management.ListenerNotFoundException
public javax.management.MBeanInfo getMBeanInfo(javax.management.ObjectName name) throws javax.management.InstanceNotFoundException, javax.management.IntrospectionException, javax.management.ReflectionException
getMBeanInfo
in interface javax.management.MBeanServer
getMBeanInfo
in interface javax.management.MBeanServerConnection
name
- the name of the mbeanjavax.management.InstanceNotFoundException
javax.management.IntrospectionException
javax.management.ReflectionException
public boolean isInstanceOf(javax.management.ObjectName name, java.lang.String className) throws javax.management.InstanceNotFoundException
isInstanceOf
in interface javax.management.MBeanServer
isInstanceOf
in interface javax.management.MBeanServerConnection
name
- the name of the mbeanclassName
- the className to test.javax.management.InstanceNotFoundException
public java.lang.ClassLoader getClassLoaderFor(javax.management.ObjectName name) throws javax.management.InstanceNotFoundException
getClassLoaderFor
in interface javax.management.MBeanServer
mbeanName
- the name of the mbeanjavax.management.InstanceNotFoundException
public java.lang.ClassLoader getClassLoader(javax.management.ObjectName loaderName) throws javax.management.InstanceNotFoundException
getClassLoader
in interface javax.management.MBeanServer
loaderName
- the name of the class loaderjavax.management.InstanceNotFoundException
public javax.management.loading.ClassLoaderRepository getClassLoaderRepository()
getClassLoaderRepository
in interface javax.management.MBeanServer
public java.io.ObjectInputStream deserialize(javax.management.ObjectName name, byte[] data) throws javax.management.InstanceNotFoundException, javax.management.OperationsException
deserialize
in interface javax.management.MBeanServer
name
- the name of the mbeandata
- the data to deserializejavax.management.InstanceNotFoundException
javax.management.OperationsException
public java.io.ObjectInputStream deserialize(java.lang.String className, byte[] data) throws javax.management.OperationsException, javax.management.ReflectionException
deserialize
in interface javax.management.MBeanServer
className
- the className matches to the loaderdata
- the data to deserializejavax.management.OperationsException
javax.management.ReflectionException
public 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.MBeanServer
className
- the className matches to the loaderloaderName
- the loader to use for deserializationdata
- the data to deserializejavax.management.OperationsException
javax.management.ReflectionException
javax.management.InstanceNotFoundException
public java.lang.String[] getDomains()
getDomains
in interface javax.management.MBeanServer
getDomains
in interface javax.management.MBeanServerConnection
public void destroy()
public java.lang.String toString()
toString
in class java.lang.Object