org.archive.util
Class JEApplicationMBean

java.lang.Object
  extended by org.archive.util.JEApplicationMBean
All Implemented Interfaces:
javax.management.DynamicMBean

public class JEApplicationMBean
extends java.lang.Object
implements javax.management.DynamicMBean

JEApplicationMBean is an example of how a JE application can incorporate JE monitoring into its existing MBean. It may be installed as is, or used as a starting point for building a MBean which includes JE support.

JE management is divided between the JEApplicationMBean class and JEMBeanHelper class. JEApplicationMBean contains an instance of JEMBeanHelper, which knows about JE attributes, operations and notifications. JEApplicationMBean itself has the responsibility of configuring, opening and closing the JE environment along with any other resources used by the application, and maintains a com.sleepycat.je.Environment handle.

The approach taken for accessing the environment is an application specific choice. Some of the salient considerations are:

Another MBean approach for environment access can be seen in com.sleepycat.je.jmx.JEMonitor. That MBean does not take responsibility for opening and closing environments, and can only operate against already-open environments.

This bean was copied from bdb je 2.0 source and modified so could pass in and monitor an environment created externally. Also added toString versions of the locks and stats calls since the objects don't seem to make it over the RMI divide (Not serializable. St.Ack


Field Summary
static java.lang.String OP_CLOSE
          This MBean provides a close operation to release the JE environment.
static java.lang.String OP_OPEN
          This MBean provides an open operation to open the JE environment.
 
Constructor Summary
JEApplicationMBean(com.sleepycat.je.Environment env)
          Instantiate a JEApplicationMBean
 
Method Summary
 java.lang.Object getAttribute(java.lang.String attributeName)
           
 javax.management.AttributeList getAttributes(java.lang.String[] attributes)
           
 javax.management.MBeanInfo getMBeanInfo()
           
 java.lang.Object invoke(java.lang.String actionName, java.lang.Object[] params, java.lang.String[] signature)
           
 void setAttribute(javax.management.Attribute attribute)
           
 javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OP_OPEN

public static final java.lang.String OP_OPEN
This MBean provides an open operation to open the JE environment.

See Also:
Constant Field Values

OP_CLOSE

public static final java.lang.String OP_CLOSE
This MBean provides a close operation to release the JE environment. Note that environments must be closed to release resources.

See Also:
Constant Field Values
Constructor Detail

JEApplicationMBean

public JEApplicationMBean(com.sleepycat.je.Environment env)
                   throws com.sleepycat.je.DatabaseException
Instantiate a JEApplicationMBean

Parameters:
env - Environment to use. Externally managed.
Throws:
com.sleepycat.je.DatabaseException
Method Detail

getAttribute

public java.lang.Object getAttribute(java.lang.String attributeName)
                              throws javax.management.AttributeNotFoundException,
                                     javax.management.MBeanException
Specified by:
getAttribute in interface javax.management.DynamicMBean
Throws:
javax.management.AttributeNotFoundException
javax.management.MBeanException
See Also:
DynamicMBean.getAttribute(java.lang.String)

setAttribute

public void setAttribute(javax.management.Attribute attribute)
                  throws javax.management.AttributeNotFoundException,
                         javax.management.InvalidAttributeValueException
Specified by:
setAttribute in interface javax.management.DynamicMBean
Throws:
javax.management.AttributeNotFoundException
javax.management.InvalidAttributeValueException
See Also:
DynamicMBean.setAttribute(javax.management.Attribute)

getAttributes

public javax.management.AttributeList getAttributes(java.lang.String[] attributes)
Specified by:
getAttributes in interface javax.management.DynamicMBean
See Also:
DynamicMBean.getAttributes(java.lang.String[])

setAttributes

public javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
Specified by:
setAttributes in interface javax.management.DynamicMBean
See Also:
DynamicMBean.setAttributes(javax.management.AttributeList)

invoke

public java.lang.Object invoke(java.lang.String actionName,
                               java.lang.Object[] params,
                               java.lang.String[] signature)
                        throws javax.management.MBeanException
Specified by:
invoke in interface javax.management.DynamicMBean
Throws:
javax.management.MBeanException
See Also:
DynamicMBean.invoke(java.lang.String, java.lang.Object[], java.lang.String[])

getMBeanInfo

public javax.management.MBeanInfo getMBeanInfo()
Specified by:
getMBeanInfo in interface javax.management.DynamicMBean
See Also:
DynamicMBean.getMBeanInfo()


Copyright © 2003-2011 Internet Archive. All Rights Reserved.