FileDocCategorySizeDatePackage
MEJBBean.javaAPI DocGlassfish v2 API12941Fri May 04 22:25:44 BST 2007com.sun.enterprise.management.agent

MEJBBean

public class MEJBBean extends Object implements SessionBean
ejbHome
<{com.sun.enterprise.management.agent.MEJBHome}>
ejbRemote
<{com.sun.enterprise.management.agent.MEJB}>
author
Hans Hrasna

Fields Summary
private SessionContext
ctx
private MEJBHelper
mejbHelper
Constructors Summary
Methods Summary
public voidejbActivate()

    
public voidejbCreate()

        this.mejbHelper = MEJBHelper.getMEJBHelper();
    
public voidejbPassivate()

    
public voidejbRemove()

    
public java.lang.ObjectgetAttribute(javax.management.ObjectName name, java.lang.String attribute)
Gets the value of a specific attribute of a named MBean. The MBean is identified by its object name.

param
name The object name of the MBean from which the attribute is to be retrieved.
param
attribute A String specifying the name of the attribute to be retrieved.
return
The value of the retrieved attribute.
exception
AttributeNotFoundException The attribute specified is not accessible in the MBean.
exception
MBeanException Wraps an exception thrown by the MBean's getter.
exception
InstanceNotFoundException The MBean specified is not registered in the MBean server.
exception
ReflectionException Wraps a java.lang.Exception thrown when trying to invoke the setter.
exception
RuntimeOperationsException Wraps a java.lang.IllegalArgumentException: The object name in parameter is null or the attribute in parameter is null.

        return this.mejbHelper.getAttribute(name,attribute);
    
public javax.management.AttributeListgetAttributes(javax.management.ObjectName name, java.lang.String[] attributes)
Enables the values of several attributes of a named MBean. The MBean is identified by its object name.

param
name The object name of the MBean from which the attributes are retrieved.
param
attributes A list of the attributes to be retrieved.
return
The list of the retrieved attributes.
exception
InstanceNotFoundException The MBean specified is not registered in the MBean server.
exception
ReflectionException An exception occurred when trying to invoke the getAttributes method of a Dynamic MBean.
exception
RuntimeOperationsException Wrap a java.lang.IllegalArgumentException: The object name in parameter is null or attributes in parameter is null.

        return this.mejbHelper.getAttributes(name,attributes);
    
public java.lang.StringgetDefaultDomain()
Returns the default domain used for naming the managed object. The default domain name is used as the domain part in the ObjectName of managed objects if no domain is specified by the user.

        return this.mejbHelper.getDefaultDomain();
    
public ListenerRegistrationgetListenerRegistry()

        return this.mejbHelper.getListenerRegistry();
    
public java.lang.IntegergetMBeanCount()
Returns the number of MBeans registered in the MBean server.

        try{
            return this.mejbHelper.getMBeanCount();
        }catch(Exception ex){
            throw new RemoteException(this.toString() +"::getMBeanCount", ex);
        }
    
public javax.management.MBeanInfogetMBeanInfo(javax.management.ObjectName name)
This method discovers the attributes and operations that an MBean exposes for management.

param
name The name of the MBean to analyze
return
An instance of MBeanInfo allowing the retrieval of all attributes and operations of this MBean.
exception
IntrospectionException An exception occurs during introspection.
exception
InstanceNotFoundException The MBean specified is not found.
exception
ReflectionException An exception occurred when trying to invoke the getMBeanInfo of a Dynamic MBean.

        return this.mejbHelper.getMBeanInfo(name);
    
public java.lang.Objectinvoke(javax.management.ObjectName name, java.lang.String operationName, java.lang.Object[] params, java.lang.String[] signature)
Invokes an operation on an MBean.

param
name The object name of the MBean on which the method is to be invoked.
param
operationName The name of the operation to be invoked.
param
params An array containing the parameters to be set when the operation is invoked
param
signature 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 MBean on which the operation was invoked.
return
The object returned by the operation, which represents the result ofinvoking the operation on the MBean specified.
exception
InstanceNotFoundException The MBean specified is not registered in the MBean server.
exception
MBeanException Wraps an exception thrown by the MBean's invoked method.
exception
ReflectionException Wraps a java.lang.Exception thrown while trying to invoke the method.

        return this.mejbHelper.invoke(name,operationName,params,signature);
    
public booleanisRegistered(javax.management.ObjectName name)
Checks whether an MBean, identified by its object name, is already registered with the MBean server.

param
name The object name of the MBean to be checked.
return
True if the MBean is already registered in the MBean server, false otherwise.

        try{
            return this.mejbHelper.isRegistered(name);
        }catch(Exception ex){
            throw new RemoteException(this.toString() +"::isRegistered", ex);
        }
    
public java.util.SetqueryNames(javax.management.ObjectName name, javax.management.QueryExp query)
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 and/or a Query expression, a specific managed object name (equivalent to testing whether an managed object is registered). When the object name is null or no domain and key properties are specified, all objects are selected (and filtered if a query is specified). It returns the set of ObjectNames for the managed objects selected.

param
name 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.
param
query The query expression to be applied for selecting managed objects. If null no query expression will be applied for selecting managed objects.
return
A set containing the ObjectNames for the managed objects selected. If no managed object satisfies the query, an empty list is returned.

        try{
            return this.mejbHelper.queryNames(name,query);
        }catch(Exception ex){
            throw new RemoteException(this.toString() +"::queryNames", ex);
        }
    
public voidsetAttribute(javax.management.ObjectName name, javax.management.Attribute attribute)
Sets the value of a specific attribute of a named MBean. The MBean is identified by its object name.

param
name The name of the MBean within which the attribute is to be set.
param
attribute The identification of the attribute to be set and the value it is to be set to.
return
The value of the attribute that has been set.
exception
InstanceNotFoundException The MBean specified is not registered in the MBean server.
exception
AttributeNotFoundException The attribute specified is not accessible in the MBean.
exception
InvalidAttributeValueException The value specified for the attribute is not valid.
exception
MBeanException Wraps an exception thrown by the MBean's setter.
exception
ReflectionException Wraps a java.lang.Exception thrown when trying to invoke the setter.
exception
RuntimeOperationsException Wraps a java.lang.IllegalArgumentException: The object name in parameter is null or the attribute in parameter is null.

	this.mejbHelper.setAttribute(name,attribute);
    
public javax.management.AttributeListsetAttributes(javax.management.ObjectName name, javax.management.AttributeList attributes)
Sets the values of several attributes of a named MBean. The MBean is identified by its object name.

param
name The object name of the MBean within which the attributes are to be set.
param
attributes A list of attributes: The identification of the attributes to be set and the values they are to be set to.
return
The list of attributes that were set, with their new values.
exception
InstanceNotFoundException The MBean specified is not registered in the MBean server.
exception
ReflectionException An exception occurred when trying to invoke the getAttributes method of a Dynamic MBean.
exception
RuntimeOperationsException Wraps a java.lang.IllegalArgumentException: The object name in parameter is null or attributes in parameter is null.

        return this.mejbHelper.setAttributes(name,attributes);
    
public voidsetSessionContext(SessionContext context)

    
        
        ctx = context;