| java.lang.Object com.adventnet.jmx.MBeanServerImpl
MBeanServerImpl | public class MBeanServerImpl implements MBeanServer(Code) | | This is the implementation class for MBean manipulation on the agent side.
It contains the necessary methods for the creation, registration,
and deletion of MBeans as well as the access methods for registered
MBeans. This is the core component of the JMX infrastructure.
version: C_VERSION |
Method Summary | |
public void | addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) Enables a couple (listener,handback) for a registered MBean to be added.
Parameters: name - The name of the MBean on which the listener should be added. Parameters: listener - The listener object which will handles notificationsemitted by the registered MBean. Parameters: filter - The filter object. | public void | addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) Enables a couple (listener,handback) for a registered MBean to be added.
Parameters: name - The name of the MBean on which the listener should be added. Parameters: listener - The listener name which will handles notificationsemitted by the registered MBean. Parameters: filter - The filter object. | public ObjectInstance | createMBean(String className, ObjectName name) Instantiates and registers a MBean with the MBeanServer.
The MBean server will use the default loader repository to load the
class of the MBean. | public ObjectInstance | createMBean(String className, ObjectName name, Object[] params, String[] signature) Instantiates and registers a MBean with the MBeanServer.
The MBean server will use the default loader repository to load the
class of the MBean. | public ObjectInstance | createMBean(String className, ObjectName name, ObjectName loaderName) Instantiates and registers a MBean with the MBeanServer.
The class loader to be used is identified by its object name. | public ObjectInstance | createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature) Instantiates and registers a MBean with the MBeanServer. | public java.io.ObjectInputStream | deserialize(ObjectName name, byte[] data) De-serializes a byte array in the context of the class loader of an MBean.
Parameters: name - The name of the MBean whose class loader should be usedfor the de-serialization. Parameters: data - The byte array to be de-sererialized. | public java.io.ObjectInputStream | deserialize(String className, byte[] data) De-serializes a byte array in the context of a given MBean class loader.
The class loader is the one that loaded the class with name "className".
Parameters: name - The name of the class whose class loader should be usedfor the de-serialization. Parameters: data - The byte array to be de-sererialized. | public java.io.ObjectInputStream | deserialize(String className, ObjectName loaderName, byte[] data) De-serializes a byte array in the context of a given MBean class loader.
The class loader is the one that loaded the class with name "className".
The name of the class loader to be used for loading the specified class
is specified. | public Object | getAttribute(ObjectName name, String attribute) Gets the value of a specific attribute of a named MBean.
The MBean is identified by its object name.
Parameters: name - The object name of the MBean from which theattribute is to be retrieved. Parameters: attribute - A String specifying the name of theattribute to be retrieved. | public AttributeList | getAttributes(ObjectName name, String[] attributes) Enables the values of several attributes of a named MBean.
The MBean is identified by its object name.
Parameters: name - The object name of the MBean from which theattributes are to be retrieved. Parameters: attributes - A list of the attributes to be retrieved. | public String | getDefaultDomain() Returns the default domain used for the MBean naming. | public Hashtable | getLoaderTable() Returns the table that has the loader references os the mbeans. | public Integer | getMBeanCount() Returns the number of MBeans controlled by the MBeanServer. | public MBeanInfo | getMBeanInfo(ObjectName name) This method discovers the attributes and operations that an MBean exposes
for management. | public Object | getObjectInClassLoader(ObjectName name, byte[] entityBody) This method de-serializes an object in the context of a given MBean
class loader.
Parameters: name - The name of the MBean which defines the class loader Parameters: entityBody - The byte array to be de-sererialized. | public ObjectInstance | getObjectInstance(ObjectName name) Gets the ObjectInstance for a given MBean registered with the MBean server.
Parameters: name - The object name of the MBean. | public Object | instantiate(String className) Instantiates an object using the list of all class loaders registered
in the MBeanServer. | public Object | instantiate(String className, Object[] params, String[] signature) Instantiates an object using the list of all class loaders registered
in the MBeanServer. | public Object | instantiate(String className, ObjectName loaderName) Instantiates an object using the class Loader specified by its ObjectName.
If the loader name is null, the system ClassLoader will be used. | public Object | instantiate(String className, ObjectName loaderName, Object[] params, String[] signature) Instantiates an object. | public Object | invoke(ObjectName name, String actionName, Object[] params, String[] signature) Invokes an action on an MBean.
Parameters: name - The object name of the MBean on which the method is to be invoked. Parameters: actionName - The name of the action to be invoked. Parameters: params - An array containing the parameters to be set when the action is invoked Parameters: signature - An array containing the signature of the action.The class objects will be loaded using the same class loaderas the one used for loading the MBean on which the action was invoked. | public boolean | isInSameClassLoader(ObjectName name, Object object) This method checks if an object has been loaded in the context of a
MBean class loader.
Parameters: name - The name of the MBean which defines the class loader Parameters: object - The object to check. | public boolean | isInstanceOf(ObjectName name, String className) Returns true if the MBean specified is an instance of the specified
class, false otherwise.
Parameters: name - The object name of the MBean to be checked. Parameters: className - The name of the class. | public boolean | isRegistered(ObjectName name) Checks whether an MBean, identified by its object name, is already
registered with the MBeanServer.
Parameters: name - The object name of the MBean to be checked. | public Set | queryMBeans(ObjectName name, QueryExp query) Gets MBeans controlled by the MBeanServer. | public Set | queryNames(ObjectName name, QueryExp query) Gets the names of MBeans controlled by the MBeanServer.
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 the ObjectName and/or a Query expression, a specific
MBean name(equivalent to testing whether an MBean is registered). | public ObjectInstance | registerMBean(Object object, ObjectName name) Registers a pre-existing object as an MBean with the MBeanServer.
If the object name given is null, the MBean may automatically
provide its own name by implementing the MBeanRegistration interface.
The call returns the MBean name.
Parameters: object - The Java Bean to be registered as an MBean. Parameters: name - The object name of the MBean. | public void | removeNotificationListener(ObjectName name, NotificationListener listener) | public void | removeNotificationListener(ObjectName name, ObjectName listener) Enables a listener for an MBean to be removed.
Parameters: name - The name of the MBean on which the listener should be removed Parameters: listener - The listener name which will handles notificationsemitted by the registered MBean. | public void | setAttribute(ObjectName name, Attribute attribute) Sets the value of a specific attribute of a named MBean.
The MBean is identified by its object name.
Parameters: name - The name of the MBean within which the attribute is to be set. Parameters: attribute - The identification of the attribute tobe set and the value it is to be set to. | public AttributeList | setAttributes(ObjectName name, AttributeList attributes) Sets the values of several attributes of a named MBean.
The MBean is identified by its object name.
Parameters: name - The object name of the MBean within which the attributes are to be set. Parameters: attributes - A list of attributes: The identification of theattributes to be set and the values they are to be set to. | public void | unregisterMBean(ObjectName name) De-registers an MBean from the MBeanServer. |
MBeanServerImpl | public MBeanServerImpl()(Code) | | Default Constructor
|
MBeanServerImpl | public MBeanServerImpl(String defaultDomain)(Code) | | Creates an MBeanServer with the specified default domain name.*
|
addNotificationListener | public void addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException(Code) | | Enables a couple (listener,handback) for a registered MBean to be added.
Parameters: name - The name of the MBean on which the listener should be added. Parameters: listener - The listener name which will handles notificationsemitted by the registered MBean. Parameters: filter - The filter object. If not specified, no filtering will beperformed before handling notifications. Parameters: handback - The context to be sent to the listener when anotification is emitted. exception: javax.management.InstanceNotFoundException - The MBean namedoesn't correspond to a registered MBean. exception: java.lang.IllegalArgumentException - The object with name "name"doesn't implements NotificationBroadcaster exception: javax.management.InstanceAlreadyExistsException - The couple(listener,handback) is already registered in the MBean. |
createMBean | public ObjectInstance createMBean(String className, ObjectName name, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException(Code) | | Instantiates and registers a MBean with the MBeanServer.
The MBean server will use the 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 can automatically provide its own
name by implementing the MBeanRegistration interface. The call returns
a reference to the new instance and its object name.
Parameters: className - The class name of the MBean to be instantiated. Parameters: name - The object name of the MBean. May be null. Parameters: params - An array containing the parameters of the constructorto be invoked. Parameters: signature - An array containing the signature of the constructorto be invoked. An ObjectInstance, containing the ObjectName and the Java classname of the newly instantiated MBean. exception: javax.management.ReflectionException - Wraps Wraps aClassNotFoundException or a java.lang.Exception thatoccured trying to invoke the MBean's constructor. exception: javax.management.InstanceAlreadyExistsException - The MBean isalready under the control of the MBeanServer. exception: javax.management.MBeanRegistrationException - The preRegister(MBeanRegistration interface) method of the MBean hasthrown an exception. The MBean will not be registered. exception: javax.management.MBeanException - The constructor of the MBeanhas thrown an exception |
createMBean | public ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException(Code) | | Instantiates and registers a MBean with the MBeanServer.
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 system ClassLoader will be used.If the MBean's object name given is
null, the MBean can automatically provide its own name by implementing
the MBeanRegistration interface. The call returns a reference to the new
instance and its object name.
Parameters: className - The class name of the MBean to be instantiated. Parameters: name - The object name of the MBean. May be null. Parameters: loaderName - The object name of the class loader to be used. An ObjectInstance, containing the ObjectName and the Java classname of the newly instantiated MBean. exception: javax.management.InstanceAlreadyExistsException - The MBean isalready under the control of the MBeanServer. exception: javax.management.MBeanRegistrationException - The preRegister(MBeanRegistration interface) method of the MBean hasthrown an exception. The MBean will not be registered. exception: javax.management.MBeanException - The constructor of the MBeanhas thrown an exception exception: javax.management.NotCompliantMBeanException - This class is notan JMX compliant MBean exception: javax.management.InstanceNotFoundException - The specified classloader is not registered in the MBeanServer. |
createMBean | public ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, RuntimeMBeanException, NotCompliantMBeanException, InstanceNotFoundException(Code) | | Instantiates and registers a MBean with the MBeanServer. 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 system ClassLoader will be used.If the MBean object
name given is null, the MBean can automatically provide its own name
by implementing the MBeanRegistration interface. The call returns a
reference to the new instance and its object name.
Parameters: className - The class name of the MBean to be instantiated. Parameters: name - The object name of the MBean. May be null. Parameters: params - An array containing the parameters of the constructorto be invoked. Parameters: signature - An array containing the signature of the constructorto be invoked. Parameters: loaderName - The object name of the class loader to be used. An ObjectInstance, containing the ObjectName and the Java classname of the newly instantiated MBean. exception: javax.management.ReflectionException - Wraps Wraps aClassNotFoundException or a java.lang.Exception thatoccured trying to invoke the MBean's constructor. exception: javax.management.InstanceAlreadyExistsException - The MBean isalready under the control of the MBeanServer. exception: javax.management.MBeanRegistrationException - The preRegister(MBeanRegistration interface) method of the MBean has thrownan exception. The MBean will not be registered. exception: javax.management.MBeanException - The constructor of the MBeanhas thrown an exception |
deserialize | public java.io.ObjectInputStream deserialize(String className, ObjectName loaderName, byte[] data) throws InstanceNotFoundException, OperationsException, ReflectionException(Code) | | De-serializes a byte array in the context of a given MBean class loader.
The class loader is the one that loaded the class with name "className".
The name of the class loader to be used for loading the specified class
is specified. If null, the MBean Server's class loader will be used.
Parameters: name - The name of the class whose class loader should be usedfor the de-serialization. Parameters: data - The byte array to be de-sererialized. Parameters: loaderName - The name of the class loader to be used for loadingthe specified class. If null, the MBean Server'sclass loader will be used. The de-serialized object stream. exception: javax.management.InstanceNotFoundException - The specifiedclass loader MBean is not found. exception: javax.management.OperationsException - Any of the usualInput/Output related exceptions. exception: javax.management.ReflectionException - The specified classcould not be loaded by the specified class loader. |
getDefaultDomain | public String getDefaultDomain()(Code) | | Returns the default domain used for the MBean naming.
|
getLoaderTable | public Hashtable getLoaderTable()(Code) | | Returns the table that has the loader references os the mbeans.
Used by the package access class.
|
getMBeanCount | public Integer getMBeanCount()(Code) | | Returns the number of MBeans controlled by the MBeanServer.
|
instantiate | public Object instantiate(String className) throws ReflectionException, MBeanException(Code) | | Instantiates an object using the list of all class loaders registered
in the MBeanServer. It returns a reference to the newly created object.
Parameters: className - The class name of the object to be instantiated. The newly instantiated object. exception: javax.management.ReflectionException - Wraps aClassNotFoundException or the java.lang.Exception thatoccured trying to invoke the object's constructor. exception: javax.management.MBeanException - The constructor of the objecthas thrown an exception |
instantiate | public Object instantiate(String className, Object[] params, String[] signature) throws ReflectionException, MBeanException(Code) | | Instantiates an object using the list of all class loaders registered
in the MBeanServer. The call returns a reference to the newly created
object.
Parameters: className - The class name of the object to be instantiated. Parameters: params - An array containing the parameters of the constructorto be invoked. Parameters: signature - An array containing the signature of the constructorto be invoked. The newly instantiated object. exception: javax.management.ReflectionException - Wraps aClassNotFoundException or the java.lang.Exception thatoccured trying to invoke the object's constructor. exception: javax.management.MBeanException - The constructor of the objecthas thrown an exception |
instantiate | public Object instantiate(String className, ObjectName loaderName, Object[] params, String[] signature) throws ReflectionException, MBeanException, InstanceNotFoundException(Code) | | Instantiates an object. The class loader to be used is identified by its
object name. If the object name of the loader is null, the system ClassLoader
will be used. The call returns a reference to the newly created object.
Parameters: className - The class name of the object to be instantiated. Parameters: params - An array containing the parameters of the constructorto be invoked. Parameters: signature - An array containing the signature of the constructorto be invoked. Parameters: loaderName - The object name of the class loader to be used. The newly instantiated object. exception: javax.management.ReflectionException - Wraps aClassNotFoundException or the java.lang.Exception thatoccured trying to invoke the object's constructor. exception: javax.management.MBeanException - The constructor of the object hasthrown an exception exception: javax.management.InstanceNotFoundException - The specified classloader is not registered in the MBeanServer. |
invoke | public Object invoke(ObjectName name, String actionName, Object[] params, String[] signature) throws InstanceNotFoundException, MBeanException, ReflectionException(Code) | | Invokes an action on an MBean.
Parameters: name - The object name of the MBean on which the method is to be invoked. Parameters: actionName - The name of the action to be invoked. Parameters: params - An array containing the parameters to be set when the action is invoked Parameters: signature - An array containing the signature of the action.The class objects will be loaded using the same class loaderas the one used for loading the MBean on which the action was invoked. The object returned by the action, which represents the resultof invoking the action on the specified MBean. exception: javax.management.InstanceNotFoundException - Thespecified MBean is not registered in the MBeanServer. exception: javax.management.MBeanException - Wraps an exceptionthrown by the MBean's invoked method. exception: javax.management.ReflectionException - Wraps anjava.lang.Exception thrown while trying to invoke the method. |
isInSameClassLoader | public boolean isInSameClassLoader(ObjectName name, Object object) throws InstanceNotFoundException(Code) | | This method checks if an object has been loaded in the context of a
MBean class loader.
Parameters: name - The name of the MBean which defines the class loader Parameters: object - The object to check. True if the object as been loaded in the context of the MBeanclass loader ; false if not. of this MBean. exception: javax.management.InstanceNotFoundException - The specifiedMBean is not found. |
isInstanceOf | public boolean isInstanceOf(ObjectName name, String className) throws InstanceNotFoundException(Code) | | Returns true if the MBean specified is an instance of the specified
class, false otherwise.
Parameters: name - The object name of the MBean to be checked. Parameters: className - The name of the class. true if the MBean is the instance of the specified class, false otherwise. exception: InstanceNotFoundException - The MBean specified is not registered in the MBean server. |
isRegistered | public boolean isRegistered(ObjectName name)(Code) | | Checks whether an MBean, identified by its object name, is already
registered with the MBeanServer.
Parameters: name - The object name of the MBean to be checked. true if the MBean is already controlled by the MBeanServer,false otherwise. |
queryMBeans | public Set queryMBeans(ObjectName name, QueryExp query)(Code) | | Gets MBeans controlled by the MBeanServer. This method allows any of
the following to be obtained: All MBeans, a set of MBeans specified by
pattern matching on the ObjectName and/or a Query expression, a specific
MBean. When the object name is null or empty, all objects are to be
selected (and filtered if a query is specified). It returns the set of
ObjectInstance objects (containing the ObjectName and the Java Class
name) for the selected MBeans.
Parameters: name - The object name pattern identifying the MBeans to beretrieved. If null orempty all the MBeans registeredwill be retrieved. Parameters: query - The query expression to be applied for selecting MBeans. A set containing the ObjectInstance objects for the selected MBeans.If no MBean satisfies the query an empty list is returned. |
queryNames | public Set queryNames(ObjectName name, QueryExp query)(Code) | | Gets the names of MBeans controlled by the MBeanServer.
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 the ObjectName and/or a Query expression, a specific
MBean name(equivalent to testing whether an MBean is registered). When
the object name is null or empty, all objects are to be selected (and
filtered if a query is specified). It returns the set of ObjectNames for
the MBeans selected.
Parameters: name - The object name pattern identifying the MBean namesto be retrieved. If null or empty, the name of allregistered MBeans will be retrieved. Parameters: query - The query expression to be applied for selecting MBeans. A set containing the ObjectNames for the MBeans selected.If no MBean satisfies the query an empty list is returned. |
removeNotificationListener | public void removeNotificationListener(ObjectName name, ObjectName listener) throws InstanceNotFoundException, ListenerNotFoundException(Code) | | Enables a listener for an MBean to be removed.
Parameters: name - The name of the MBean on which the listener should be removed Parameters: listener - The listener name which will handles notificationsemitted by the registered MBean. This method will removeall information related to this listener. exception: javax.management.InstanceNotFoundException - The MBean name orthe listener name doesn't correspond to a registered MBean exception: javax.management.ListenerNotFoundException - The couple(listener,handback) is not registered in the MBean. Theexception message contains either "listener", "handback" orthe object name depending on which object cannot be found. exception: java.lang.IllegalArgumentException - The object with name "name"doesn't implements NotificationBroadcaster or the objectwith name "listener" doesn't implements NotificationListener.The faulty ObjectName string representation can be obtainedby means of the getMessage() method of theIllegalArgumentException object. |
setAttributes | public AttributeList setAttributes(ObjectName name, AttributeList attributes) throws InstanceNotFoundException, ReflectionException(Code) | | Sets the values of several attributes of a named MBean.
The MBean is identified by its object name.
Parameters: name - The object name of the MBean within which the attributes are to be set. Parameters: attributes - A list of attributes: The identification of theattributes to be set and the values they are to be set to. The list of attributes that were set, with their new values. exception: javax.management.InstanceNotFoundException - The specifiedMBean is not registered in the MBeanServer. |
|
|