FileDocCategorySizeDatePackage
CustomMBeanOperationsMBean.javaAPI DocGlassfish v2 API8489Fri May 04 22:24:10 BST 2007com.sun.enterprise.admin.mbeans.custom

CustomMBeanOperationsMBean

public interface CustomMBeanOperationsMBean
Interface that defines the behavior of modifying the configuration in the admin server for custom mbeans. Though this is mostly similar to a J2EE application or module deployment, in order to factor out the Custom MBean Configuration changes, this interface is defined. Note that target is a central concept in the deployment of applications and mbeans. In all the interface methods that are defined here, the target must be a server or a cluster. A special target with name "server" defines a domain. The handling of targets is defined in the Custom MBean design document.
since
SJSAS9.0

Fields Summary
Constructors Summary
Methods Summary
public java.lang.StringcreateMBean(java.lang.String target, java.lang.String className)
Creates an MBean with given className in given target. Results in the call to #createMBean(String, String, Map, Map). The Map will be empty, so will be Map.

param
target String representing the target
param
className String representing the implementation class

public java.lang.StringcreateMBean(java.lang.String target, java.util.Map params)
Creates an MBean with given className in given target. Results in the call to #createMBean(String, String, Map, Map). The Map should contain the 0 or more items from the @link{CustomMBeanConstants} class.
  • class-name of the custom mbean, which is mandatory
  • name of the custom mbean
  • object-name of the custom mbean

param
target String representing the target
param
params a Map explained above

public java.lang.StringcreateMBean(java.lang.String target, java.util.Map params, java.util.Map attributes)
Creates an MBean with given class-name in the given target's configuration. The class-name may not be null. The class must represent a valid JMX MBean implementation. All the standard requirements must be fulfilled by the given class. Here is a list of requirements from the given class-name. It is by no means an exhaustive one. Refer to the design document for the complete list.
  • The class-name may not be null
  • It must be instantiable with a default constructor
  • The class bits must be available in order to be loaded dynamically, knowing full name
  • Refer to the class Javadoc for a note on target. The various mappings in the params map are as follows:
    • String CustomMBeanConstants.NAME_KEY -> name of the MBean
    • Mandatory String CustomMBeanConstants.IMPL_CLASS_NAME_KEY -> the actual class
    • String CustomMBeanConstants.OBJECT_NAME_KEY -> intended ObjectName of the MBean

    param
    target String representing target where the MBean would be instantiated. The value null represents the domain as the target
    param
    params a Map with mappings between String and String containing various configuration parameters
    param
    attributes a Map between two Strings repsenting name of an attribute and String representation of its value.
    throws
    All the createMBean methods in this class throw CustomMBeanException if the custom MBean definition is invalid or if we can guarantee that the registration of the MBean at a latter point in time without any change in the runtime state of the system would be successful.
    return
    the name of the MBean as determined by the backend. The name returned is guaranteed to be unique amongst all application sub-elements.

public voidcreateMBeanRef(java.lang.String target, java.lang.String ref)
Creates a reference to the given MBean. It is a misnomer in that it actually creates an application-ref sub-element in a server, but it is named so for functional clarity. This is available only in EE of appserver because it is against a precedent to create references in PE.

param
target String representing the target, could be cluster or a server instance. A null value represents the domain itself.
param
ref String representing the name of the custom MBean definition
throws
CustomMBeanException if the custom MBean reference could not be created for some reason

public java.lang.StringdeleteMBean(java.lang.String target, java.lang.String name)
Deletes the MBean with the given name from the configuration and optionally deletes the corresponding classes from the file system. The deletion of classes should not be relied upon by the clients. Refer to the design document for exact semantics of this method.

public voiddeleteMBeanRef(java.lang.String target, java.lang.String ref)
Deletes a reference to the given MBean from a server or cluster. It is a misnomer in that it actually deletes an application-ref sub-element from a server, but it is named so for functional clarity. This is available only in EE of appserver because it is against a precedent to delete references in PE.

param
target String representing the target, could be cluster or a server instance
param
ref String representing the name of the custom MBean definition, which is same as as the referenced name
throws
CustomMBeanException if the custom MBean reference could not be deleted for some reason

public javax.management.MBeanInfogetMBeanInfo(java.lang.String classname)
Return the MBeanInfo of a given Custom MBean. The MBean must be loadable from the standard App Server location. The code does this:
  • Register the MBean in the MBeanServer
  • Fetch and save the MBeanInfo
  • Unregister the MBean
Note that if the MBean can't be deployed successfully then this method won't work.

param
classname
throws
com.sun.enterprise.admin.mbeans.custom.CustomMBeanException
return
The MBeanInfo object