|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.rhq.plugins.jmx.MBeanResourceComponent<T>
public class MBeanResourceComponent<T extends JMXComponent>
A generic JMX MBean resource component that can be used to manage a JMX MBean. The resource's plugin configuration will determine what MBean is to be managed by this component.
| Field Summary | |
|---|---|
protected org.mc4j.ems.connection.bean.EmsBean |
bean
Deprecated. do not use this - use getEmsBean() instead |
protected static org.apache.commons.logging.Log |
log
Subclasses are free to use this directly as a way to log messages. |
static String |
OBJECT_NAME_PROP
|
static String |
PROPERTY_TRANSFORM
|
protected ResourceContext<T> |
resourceContext
Deprecated. do not use this - use getResourceContext() instead |
| Fields inherited from interface org.rhq.plugins.jmx.JMXComponent |
|---|
CREDENTIALS_CONFIG_PROP, PRINCIPAL_CONFIG_PROP |
| Constructor Summary | |
|---|---|
MBeanResourceComponent()
|
|
| Method Summary | |
|---|---|
protected String |
getAttributeName(String property)
|
protected String |
getAttributeProperty(String property)
|
AvailabilityType |
getAvailability()
Is this service alive? |
protected void |
getBeanProperties(MeasurementReport report,
org.mc4j.ems.connection.bean.EmsBean thisBean,
Set<MeasurementScheduleRequest> requests)
|
org.mc4j.ems.connection.bean.EmsBean |
getEmsBean()
Gets the loaded MBean. |
org.mc4j.ems.connection.EmsConnection |
getEmsConnection()
|
ResourceContext<T> |
getResourceContext()
|
void |
getValues(MeasurementReport report,
Set<MeasurementScheduleRequest> requests)
|
protected void |
getValues(MeasurementReport report,
Set<MeasurementScheduleRequest> requests,
org.mc4j.ems.connection.bean.EmsBean bean)
Can be called from sub-classes to collect metrics on a bean other than the default bean for this resource Supports {a.b} syntax for reading the b Java Bean property from the object value returned from the a jmx property. |
OperationResult |
invokeOperation(String name,
Configuration parameters)
|
OperationResult |
invokeOperation(String name,
Configuration parameters,
org.mc4j.ems.connection.bean.EmsBean emsBean)
|
protected org.mc4j.ems.connection.bean.EmsBean |
loadBean()
Loads the MBean in a default way. |
protected org.mc4j.ems.connection.bean.EmsBean |
loadBean(String objectName)
Loads the bean with the given object name. |
Configuration |
loadResourceConfiguration()
This default setup of configuration properties can map to mbean attributes |
protected Object |
lookupAttributeProperty(Object value,
String property)
|
protected void |
setEmsBean(org.mc4j.ems.connection.bean.EmsBean bean)
Sets the MBean that this component considers loaded. |
protected void |
setResourceContext(ResourceContext<T> resourceContext)
|
void |
start(ResourceContext<T> context)
Stores the context and loads the MBean. |
void |
stop()
Cleans the old resource context and the old MBean. |
protected String |
transformBeanName(String beanTemplate)
|
void |
updateResourceConfiguration(ConfigurationUpdateReport report)
Equivalent to updateResourceConfiguration(report, false); |
void |
updateResourceConfiguration(ConfigurationUpdateReport report,
boolean ignoreReadOnly)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static org.apache.commons.logging.Log log
public static final String OBJECT_NAME_PROP
public static final String PROPERTY_TRANSFORM
protected org.mc4j.ems.connection.bean.EmsBean bean
getEmsBean() insteadprotected ResourceContext<T extends JMXComponent> resourceContext
getResourceContext() instead| Constructor Detail |
|---|
public MBeanResourceComponent()
| Method Detail |
|---|
public void start(ResourceContext<T> context)
start in interface ResourceComponent<T extends JMXComponent>ResourceComponent.start(ResourceContext)public void stop()
stop in interface ResourceComponent<T extends JMXComponent>ResourceComponent.stop()public org.mc4j.ems.connection.bean.EmsBean getEmsBean()
load the bean if it
is not yet loaded. This might still return null if the MBean could
not be loaded.
IllegalStateException - if it could not be loadedloadBean()protected void setEmsBean(org.mc4j.ems.connection.bean.EmsBean bean)
bean - the new MBean representing the component resourcepublic ResourceContext<T> getResourceContext()
protected void setResourceContext(ResourceContext<T> resourceContext)
protected org.mc4j.ems.connection.bean.EmsBean loadBean()
OBJECT_NAME_PROP and uses that
as the object name to load via loadBean(String).
Subclasses are free to override this method in order to provide its own
default loading mechanism.
protected org.mc4j.ems.connection.bean.EmsBean loadBean(String objectName)
objectName - the name of the bean to load
public AvailabilityType getAvailability()
getAvailability in interface AvailabilityFacet
public void getValues(MeasurementReport report,
Set<MeasurementScheduleRequest> requests)
getValues in interface MeasurementFacet
protected void getValues(MeasurementReport report,
Set<MeasurementScheduleRequest> requests,
org.mc4j.ems.connection.bean.EmsBean bean)
report - requests - bean - the EmsBean on which to collect the metricsprotected String transformBeanName(String beanTemplate)
protected void getBeanProperties(MeasurementReport report,
org.mc4j.ems.connection.bean.EmsBean thisBean,
Set<MeasurementScheduleRequest> requests)
protected Object lookupAttributeProperty(Object value,
String property)
protected String getAttributeName(String property)
protected String getAttributeProperty(String property)
public Configuration loadResourceConfiguration()
loadResourceConfiguration in interface ConfigurationFacetpublic void updateResourceConfiguration(ConfigurationUpdateReport report)
updateResourceConfiguration in interface ConfigurationFacet
public void updateResourceConfiguration(ConfigurationUpdateReport report,
boolean ignoreReadOnly)
public org.mc4j.ems.connection.EmsConnection getEmsConnection()
getEmsConnection in interface JMXComponent<T extends JMXComponent>
public OperationResult invokeOperation(String name,
Configuration parameters)
throws Exception
invokeOperation in interface OperationFacetException
public OperationResult invokeOperation(String name,
Configuration parameters,
org.mc4j.ems.connection.bean.EmsBean emsBean)
throws Exception
Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||