Top Description Methods
javax.management.j2ee

public Interface Management

extends EJBObject
Imports
java.util.Set, javax.management.ObjectName, .QueryExp, .AttributeList, .Attribute, .MBeanInfo, .InstanceNotFoundException, .MBeanException, .AttributeNotFoundException, .ReflectionException, .InvalidAttributeValueException, .IntrospectionException, java.rmi.RemoteException

The Management interface provides the APIs to navigate and manipulate managed objects. The J2EE Management EJB component (MEJB) must implement this as its remote interface.
Author
Hans Hrasna

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

The value of the retrieved attribute.
getAttribute
(ObjectName
The object name of the managed object from which the attribute is to be retrieved.
name
,
String
A String specifying the name of the attribute to be retrieved.
attribute
)

Gets the value of a specific attribute of a named managed object.

public AttributeList

Returns:

The list of the retrieved attributes.
getAttributes
(ObjectName
The object name of the managed object from which the attributes are retrieved.
name
,
String[]
A list of the attributes to be retrieved.
attributes
)

Enables the values of several attributes of a named managed object.

public String
getDefaultDomain()

Returns the default domain name of this MEJB.

public ListenerRegistration

Returns:

An implementation of javax.management.j2ee.ListenerRegistration
getListenerRegistry
()

Returns the listener registry implementation for this MEJB.

public Integer
getMBeanCount()

Returns the number of managed objects registered in the MEJB.

public MBeanInfo

Returns:

An instance of MBeanInfo allowing the retrieval of all attributes and operations of this managed object.
getMBeanInfo
(ObjectName
The name of the managed object to analyze
name
)

This method discovers the attributes and operations that a managed object exposes for management.

public Object

Returns:

The object returned by the operation, which represents the result of invoking the operation on the managed object specified.
invoke
(ObjectName
The object name of the managed object on which the method is to be invoked.
name
,
String
The name of the operation to be invoked.
operationName
,
Object[]
An array containing the parameters to be set when the operation is invoked
params
,
String[]
An array containing the signature of the operation. The class objects will be loaded using the same class loader as the one used for loading the managed object on which the operation was invoked.
signature
)

Invokes an operation on a managed object.

public boolean

Returns:

True if the managed object is already registered in the MEJB, false otherwise.
isRegistered
(ObjectName
The object name of the managed object to be checked.
name
)

Checks whether a managed object, identified by its object name, is already registered with the MEJB.

public Set<E>

Returns:

A set containing the ObjectNames for the managed objects selected. If no managed object satisfies the query, an empty set is returned.
queryNames
(ObjectName
The object name pattern identifying the managed objects to be retrieved. If null or no domain and key properties are specified, all the managed objects registered will be retrieved.
name
,
QueryExp query)

Gets the names of managed objects controlled by the MEJB.

public void
setAttribute(ObjectName
The name of the managed object within which the attribute is to be set.
name
,
Attribute
The identification of the attribute to be set and the value it is to be set to.
attribute
)

Sets the value of a specific attribute of a named managed object.

public AttributeList

Returns:

The list of attributes that were set, with their new values.
setAttributes
(ObjectName
The object name of the managed object within which the attributes are to be set.
name
,
AttributeList
A list of attributes: The identification of the attributes to be set and the values they are to be set to.
attributes
)

Sets the values of several attributes of a named managed object.

Inherited from javax.ejb.EJBObject:
getEJBHomegetHandlegetPrimaryKeyisIdenticalremove

Method Detail

getAttributeback to summary
public Object getAttribute(ObjectName name, String attribute) throws MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException, RemoteException

Gets the value of a specific attribute of a named managed object. The managed object is identified by its object name.

Parameters
name:ObjectName

The object name of the managed object from which the attribute is to be retrieved.

attribute:String

A String specifying the name of the attribute to be retrieved.

Returns:Object

The value of the retrieved attribute.

Exceptions
MBeanException:
Wraps an exception thrown by the managed object's getter.
AttributeNotFoundException:
The attribute specified is not accessible in the managed object.
InstanceNotFoundException:
The managed object specified is not registered in the MEJB.
ReflectionException:
An exception occurred when trying to invoke the getAttribute method of a Dynamic MBean
RemoteException:
A communication exception occurred during the execution of a remote method call
getAttributesback to summary
public AttributeList getAttributes(ObjectName name, String[] attributes) throws InstanceNotFoundException, ReflectionException, RemoteException

Enables the values of several attributes of a named managed object. The managed object is identified by its object name.

Parameters
name:ObjectName

The object name of the managed object from which the attributes are retrieved.

attributes:String[]

A list of the attributes to be retrieved.

Returns:AttributeList

The list of the retrieved attributes.

Exceptions
InstanceNotFoundException:
The managed object specified is not registered in the MEJB.
ReflectionException:
An exception occurred when trying to invoke the getAttributes method of a Dynamic MBean.
RemoteException:
A communication exception occurred during the execution of a remote method call
getDefaultDomainback to summary
public String getDefaultDomain() throws RemoteException

Returns the default domain name of this MEJB.

Exceptions
RemoteException:
A communication exception occurred during the execution of a remote method call
getListenerRegistryback to summary
public ListenerRegistration getListenerRegistry() throws RemoteException

Returns the listener registry implementation for this MEJB. The listener registry implements the methods that enable clints to add and remove event notification listeners managed objects

Returns:ListenerRegistration

An implementation of javax.management.j2ee.ListenerRegistration

Exceptions
RemoteException:
A communication exception occurred during the execution of a remote method call
getMBeanCountback to summary
public Integer getMBeanCount() throws RemoteException

Returns the number of managed objects registered in the MEJB.

Exceptions
RemoteException:
A communication exception occurred during the execution of a remote method call
getMBeanInfoback to summary
public MBeanInfo getMBeanInfo(ObjectName name) throws IntrospectionException, InstanceNotFoundException, ReflectionException, RemoteException

This method discovers the attributes and operations that a managed object exposes for management.

Parameters
name:ObjectName

The name of the managed object to analyze

Returns:MBeanInfo

An instance of MBeanInfo allowing the retrieval of all attributes and operations of this managed object.

Exceptions
IntrospectionException:
An exception occurs during introspection.
InstanceNotFoundException:
The managed object specified is not found.
ReflectionException:
An exception occurred when trying to perform reflection on a managed object
RemoteException:
A communication exception occurred during the execution of a remote method call
invokeback to summary
public Object invoke(ObjectName name, String operationName, Object[] params, String[] signature) throws InstanceNotFoundException, MBeanException, ReflectionException, RemoteException

Invokes an operation on a managed object.

Parameters
name:ObjectName

The object name of the managed object on which the method is to be invoked.

operationName:String

The name of the operation to be invoked.

params:Object[]

An array containing the parameters to be set when the operation is invoked

signature:String[]

An array containing the signature of the operation. The class objects will be loaded using the same class loader as the one used for loading the managed object on which the operation was invoked.

Returns:Object

The object returned by the operation, which represents the result of invoking the operation on the managed object specified.

Exceptions
InstanceNotFoundException:
The managed object specified is not registered in the MEJB.
MBeanException:
Wraps an exception thrown by the managed object's invoked method.
ReflectionException:
Wraps a java.lang.Exception thrown while trying to invoke the method.
RemoteException:
A communication exception occurred during the execution of a remote method call
isRegisteredback to summary
public boolean isRegistered(ObjectName name) throws RemoteException

Checks whether a managed object, identified by its object name, is already registered with the MEJB.

Parameters
name:ObjectName

The object name of the managed object to be checked.

Returns:boolean

True if the managed object is already registered in the MEJB, false otherwise.

Exceptions
RemoteException:
A communication exception occurred during the execution of a remote method call
queryNamesback to summary
public Set<E> queryNames(ObjectName name, QueryExp query) throws RemoteException

Gets the names of managed objects controlled by the MEJB. This method enables any of the following to be obtained: The names of all managed objects, the names of a set of managed objects specified by pattern matching on the ObjectName, a specific managed object name (equivalent to testing whether a managed object is registered). When the object name is null or no domain and key properties are specified, all objects are selected. It returns the set of J2EEObjectNames for the managed objects selected.

Parameters
name:ObjectName

The object name pattern identifying the managed objects to be retrieved. If null or no domain and key properties are specified, all the managed objects registered will be retrieved.

Returns:Set<E>

A set containing the ObjectNames for the managed objects selected. If no managed object satisfies the query, an empty set is returned.

Exceptions
RemoteException:
A communication exception occurred during the execution of a remote method call
setAttributeback to summary
public void setAttribute(ObjectName name, Attribute attribute) throws InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException, RemoteException

Sets the value of a specific attribute of a named managed object. The managed object is identified by its object name.

Parameters
name:ObjectName

The name of the managed object within which the attribute is to be set.

attribute:Attribute

The identification of the attribute to be set and the value it is to be set to.

Exceptions
InstanceNotFoundException:
The managed object specified is not registered in the MEJB.
AttributeNotFoundException:
The attribute specified is not accessible in the managed object.
InvalidAttributeValueException:
The value specified for the attribute is not valid.
MBeanException:
Wraps an exception thrown by the managed object's setter.
ReflectionException:
An exception occurred when trying to invoke the setAttribute method of a Dynamic MBean.
RemoteException:
A communication exception occurred during the execution of a remote method call
setAttributesback to summary
public AttributeList setAttributes(ObjectName name, AttributeList attributes) throws InstanceNotFoundException, ReflectionException, RemoteException

Sets the values of several attributes of a named managed object. The managed object is identified by its object name.

Parameters
name:ObjectName

The object name of the managed object within which the attributes are to be set.

attributes:AttributeList

A list of attributes: The identification of the attributes to be set and the values they are to be set to.

Returns:AttributeList

The list of attributes that were set, with their new values.

Exceptions
InstanceNotFoundException:
The managed object specified is not registered in the MEJB.
ReflectionException:
An exception occurred when trying to invoke the setAttributes method of a Dynamic MBean.
RemoteException:
A communication exception occurred during the execution of a remote method call