| java.lang.Object org.archive.util.JEMBeanHelper
JEMBeanHelper | public class JEMBeanHelper (Code) | | JEMBeanHelper is a utility class for the MBean implementation which wants to
add management of a JE environment to its capabilities. MBean
implementations can contain a JEMBeanHelper instance to get MBean metadata
for JE and to set attributes, get attributes, and invoke operations.
com.sleepycat.je.jmx.JEMonitor and
the example program jmx.JEApplicationMBean are two MBean implementations
which provide support different application use cases. See those classes for
examples of how to use JEMBeanHelper.
This class was copied from the bdb je 2.0 jmx examples.
|
Constructor Summary | |
public | JEMBeanHelper(EnvironmentConfig config, File environmentHome, boolean canConfigure) Instantiate a helper, specifying environment home and open capabilities. |
Method Summary | |
public Object | getAttribute(Environment targetEnv, String attributeName) Get an attribute value for the given environment. | public List<MBeanAttributeInfo> | getAttributeList(Environment targetEnv) Get MBean attribute metadata for this environment.
Parameters: targetEnv - The target JE environment. | public File | getEnvironmentHome() Return the target environment directory. | public Environment | getEnvironmentIfOpen() Return an Environment only if the environment has already been opened
in this process. | public EnvironmentConfig | getEnvironmentOpenConfig() If the helper was instantiated with canConfigure==true, it shows
environment configuration attributes. | public synchronized boolean | getNeedReset() Tell the MBean if the available set of functionality has changed. | public MBeanNotificationInfo[] | getNotificationInfo(Environment targetEnv) No notifications are supported. | public List<MBeanOperationInfo> | getOperationList(Environment targetEnv) Get mbean operation metadata for this environment.
Parameters: targetEnv - The target JE environment. | public Object | invoke(Environment targetEnv, String actionName, Object[] params, String[] signature) Invoke an operation for the given environment.
Parameters: targetEnv - The target JE environment. | public void | setAttribute(Environment targetEnv, Attribute attribute) Set an attribute value for the given environment.
Parameters: targetEnv - The target JE environment. |
ATT_CACHE_PERCENT | final public static String ATT_CACHE_PERCENT(Code) | | |
ATT_CACHE_SIZE | final public static String ATT_CACHE_SIZE(Code) | | |
ATT_IS_READ_ONLY | final public static String ATT_IS_READ_ONLY(Code) | | |
ATT_IS_SERIALIZABLE | final public static String ATT_IS_SERIALIZABLE(Code) | | |
ATT_IS_TRANSACTIONAL | final public static String ATT_IS_TRANSACTIONAL(Code) | | |
ATT_LOCK_TIMEOUT | final public static String ATT_LOCK_TIMEOUT(Code) | | |
ATT_SET_READ_ONLY | final public static String ATT_SET_READ_ONLY(Code) | | |
ATT_SET_SERIALIZABLE | final public static String ATT_SET_SERIALIZABLE(Code) | | |
ATT_SET_TRANSACTIONAL | final public static String ATT_SET_TRANSACTIONAL(Code) | | |
ATT_TXN_TIMEOUT | final public static String ATT_TXN_TIMEOUT(Code) | | |
JEMBeanHelper | public JEMBeanHelper(EnvironmentConfig config, File environmentHome, boolean canConfigure)(Code) | | Instantiate a helper, specifying environment home and open capabilities.
Parameters: environmentHome - home directory of the target JE environment. Parameters: canConfigure - If true, the helper will show environmentconfiguration attributes. |
getAttribute | public Object getAttribute(Environment targetEnv, String attributeName) throws AttributeNotFoundException, MBeanException(Code) | | Get an attribute value for the given environment. Check
JEMBeanHelper.getNeedReset() after this call because the helper may
detect that the environment has changed and that the MBean metadata
should be reset.
Parameters: targetEnv - The target JE environment. May be null if theenvironment is not open. Parameters: attributeName - attribute name. attribute value. |
getAttributeList | public List<MBeanAttributeInfo> getAttributeList(Environment targetEnv)(Code) | | Get MBean attribute metadata for this environment.
Parameters: targetEnv - The target JE environment. May be null if theenvironment is not open. list of MBeanAttributeInfo objects describing the availableattributes. |
getEnvironmentHome | public File getEnvironmentHome()(Code) | | Return the target environment directory.
the environment directory. |
getEnvironmentIfOpen | public Environment getEnvironmentIfOpen()(Code) | | Return an Environment only if the environment has already been opened
in this process. A helper method for MBeans which want to only access
open environments.
Environment if already open, null if not open. |
getEnvironmentOpenConfig | public EnvironmentConfig getEnvironmentOpenConfig()(Code) | | If the helper was instantiated with canConfigure==true, it shows
environment configuration attributes. Those attributes are returned
within this EnvironmentConfig object for use in opening environments.
EnvironmentConfig object which saves configuration attributesrecorded through MBean attributes. |
getNeedReset | public synchronized boolean getNeedReset()(Code) | | Tell the MBean if the available set of functionality has changed.
true if the MBean should regenerate its JE metadata. |
getNotificationInfo | public MBeanNotificationInfo[] getNotificationInfo(Environment targetEnv)(Code) | | No notifications are supported.
List of MBeanNotificationInfo for available notifications. |
getOperationList | public List<MBeanOperationInfo> getOperationList(Environment targetEnv)(Code) | | Get mbean operation metadata for this environment.
Parameters: targetEnv - The target JE environment. May be null if theenvironment is not open. List of MBeanOperationInfo describing available operations. |
invoke | public Object invoke(Environment targetEnv, String actionName, Object[] params, String[] signature) throws MBeanException(Code) | | Invoke an operation for the given environment.
Parameters: targetEnv - The target JE environment. May be null if theenvironment is not open. Parameters: actionName - operation name. Parameters: params - operation parameters. May be null. Parameters: signature - operation signature. May be null. the operation result |
|
|