public class JEMonitor
extends java.lang.Object
implements javax.management.DynamicMBean
In this MBean, JE management is divided between the JEMonitor class and JEMBeanHelper class. JEMonitor contains an instance of JEMBeanHelper, which knows about JE attributes, operations and notifications. JEMonitor itself has the responsibility of obtaining a temporary handle for the JE environment.
The key implementation choice for a JE MBean is the approach taken for accessing the JE environment. Some of the salient considerations are:
Because of these considerations, JEMonitor avoids holding a JE environment handle in order to not impact the environment lifetime. Any environment handles used are held temporarily.
Constructor and Description |
---|
JEMonitor(java.lang.String environmentHome)
Instantiate a JEMonitor
|
Modifier and Type | Method and Description |
---|---|
protected void |
closeEnvironment(Environment targetEnv)
Be sure to close Environments when they are no longer used, because
they pin down resources.
|
java.lang.Object |
getAttribute(java.lang.String attributeName) |
javax.management.AttributeList |
getAttributes(java.lang.String[] attributes) |
protected Environment |
getEnvironmentIfOpen()
This MBean has the policy of only accessing an environment when
it has already been configured and opened by other
application threads.
|
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) |
public JEMonitor(java.lang.String environmentHome) throws javax.management.MBeanException
environmentHome
- home directory of the target JE environment.javax.management.MBeanException
public java.lang.Object getAttribute(java.lang.String attributeName) throws javax.management.AttributeNotFoundException, javax.management.MBeanException
getAttribute
in interface javax.management.DynamicMBean
javax.management.AttributeNotFoundException
javax.management.MBeanException
DynamicMBean.getAttribute(java.lang.String)
public void setAttribute(javax.management.Attribute attribute) throws javax.management.AttributeNotFoundException, javax.management.InvalidAttributeValueException, javax.management.MBeanException
setAttribute
in interface javax.management.DynamicMBean
javax.management.AttributeNotFoundException
javax.management.InvalidAttributeValueException
javax.management.MBeanException
DynamicMBean.setAttribute(javax.management.Attribute)
public javax.management.AttributeList getAttributes(java.lang.String[] attributes)
getAttributes
in interface javax.management.DynamicMBean
DynamicMBean.getAttributes(java.lang.String[])
public javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
setAttributes
in interface javax.management.DynamicMBean
DynamicMBean.setAttributes(javax.management.AttributeList)
public java.lang.Object invoke(java.lang.String actionName, java.lang.Object[] params, java.lang.String[] signature) throws javax.management.MBeanException
invoke
in interface javax.management.DynamicMBean
javax.management.MBeanException
DynamicMBean.invoke(java.lang.String, java.lang.Object[], java.lang.String[])
public javax.management.MBeanInfo getMBeanInfo()
getMBeanInfo
in interface javax.management.DynamicMBean
DynamicMBean.getMBeanInfo()
protected Environment getEnvironmentIfOpen()
protected void closeEnvironment(Environment targetEnv) throws javax.management.MBeanException
targetEnv
- the open environment. May be null.javax.management.MBeanException