|
|||||||||
| 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 java.lang.String |
OBJECT_NAME_PROP
|
static java.lang.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 java.lang.String |
getAttributeName(java.lang.String property)
|
protected java.lang.String |
getAttributeProperty(java.lang.String property)
|
AvailabilityType |
getAvailability()
Is this service alive? |
protected void |
getBeanProperties(MeasurementReport report,
org.mc4j.ems.connection.bean.EmsBean thisBean,
java.util.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,
java.util.Set<MeasurementScheduleRequest> requests)
|
protected void |
getValues(MeasurementReport report,
java.util.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(java.lang.String name,
Configuration parameters)
|
OperationResult |
invokeOperation(java.lang.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(java.lang.String objectName)
Loads the bean with the given object name. |
Configuration |
loadResourceConfiguration()
This default setup of configuration properties can map to mbean attributes |
protected java.lang.Object |
lookupAttributeProperty(java.lang.Object value,
java.lang.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 java.lang.String |
transformBeanName(java.lang.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 java.lang.String OBJECT_NAME_PROP
public static final java.lang.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.
null 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(java.lang.String objectName)
objectName - the name of the bean to load
public AvailabilityType getAvailability()
getAvailability in interface AvailabilityFacet
public void getValues(MeasurementReport report,
java.util.Set<MeasurementScheduleRequest> requests)
getValues in interface MeasurementFacet
protected void getValues(MeasurementReport report,
java.util.Set<MeasurementScheduleRequest> requests,
org.mc4j.ems.connection.bean.EmsBean bean)
report - requests - bean - the EmsBean on which to collect the metricsprotected java.lang.String transformBeanName(java.lang.String beanTemplate)
protected void getBeanProperties(MeasurementReport report,
org.mc4j.ems.connection.bean.EmsBean thisBean,
java.util.Set<MeasurementScheduleRequest> requests)
protected java.lang.Object lookupAttributeProperty(java.lang.Object value,
java.lang.String property)
protected java.lang.String getAttributeName(java.lang.String property)
protected java.lang.String getAttributeProperty(java.lang.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(java.lang.String name,
Configuration parameters)
throws java.lang.Exception
invokeOperation in interface OperationFacetjava.lang.Exception
public OperationResult invokeOperation(java.lang.String name,
Configuration parameters,
org.mc4j.ems.connection.bean.EmsBean emsBean)
throws java.lang.Exception
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||