public class MBeanResourceComponent<T extends JMXComponent<?>> extends Object implements MeasurementFacet, OperationFacet, ConfigurationFacet, JMXComponent<T>
| Modifier and Type | Field and Description |
|---|---|
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 |
CREDENTIALS_CONFIG_PROP, PRINCIPAL_CONFIG_PROP| Constructor and Description |
|---|
MBeanResourceComponent() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
getAttributeName(String property) |
protected String |
getAttributeProperty(String property) |
org.rhq.core.domain.measurement.AvailabilityType |
getAvailability()
Is this service alive?
|
protected void |
getBeanProperties(org.rhq.core.domain.measurement.MeasurementReport report,
org.mc4j.ems.connection.bean.EmsBean thisBean,
Set<org.rhq.core.domain.measurement.MeasurementScheduleRequest> requests) |
org.mc4j.ems.connection.bean.EmsBean |
getEmsBean()
Gets the loaded MBean.
|
org.mc4j.ems.connection.EmsConnection |
getEmsConnection() |
protected Object |
getPropertyValueAsType(org.rhq.core.domain.configuration.PropertySimple propSimple,
String typeName) |
ResourceContext<T> |
getResourceContext() |
void |
getValues(org.rhq.core.domain.measurement.MeasurementReport report,
Set<org.rhq.core.domain.measurement.MeasurementScheduleRequest> requests) |
protected void |
getValues(org.rhq.core.domain.measurement.MeasurementReport report,
Set<org.rhq.core.domain.measurement.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,
org.rhq.core.domain.configuration.Configuration parameters) |
OperationResult |
invokeOperation(String name,
org.rhq.core.domain.configuration.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.
|
org.rhq.core.domain.configuration.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) |
protected static org.apache.commons.logging.Log log
public static final String OBJECT_NAME_PROP
public static final String PROPERTY_TRANSFORM
@Deprecated protected org.mc4j.ems.connection.bean.EmsBean bean
getEmsBean() instead@Deprecated protected ResourceContext<T extends JMXComponent<?>> resourceContext
getResourceContext() insteadpublic 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 loadpublic org.rhq.core.domain.measurement.AvailabilityType getAvailability()
getAvailability in interface AvailabilityFacetpublic void getValues(org.rhq.core.domain.measurement.MeasurementReport report,
Set<org.rhq.core.domain.measurement.MeasurementScheduleRequest> requests)
getValues in interface MeasurementFacetprotected void getValues(org.rhq.core.domain.measurement.MeasurementReport report,
Set<org.rhq.core.domain.measurement.MeasurementScheduleRequest> requests,
org.mc4j.ems.connection.bean.EmsBean bean)
report - requests - bean - the EmsBean on which to collect the metricsprotected void getBeanProperties(org.rhq.core.domain.measurement.MeasurementReport report,
org.mc4j.ems.connection.bean.EmsBean thisBean,
Set<org.rhq.core.domain.measurement.MeasurementScheduleRequest> requests)
public org.rhq.core.domain.configuration.Configuration loadResourceConfiguration()
loadResourceConfiguration in interface ConfigurationFacetpublic void updateResourceConfiguration(ConfigurationUpdateReport report)
updateResourceConfiguration in interface ConfigurationFacetpublic 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, org.rhq.core.domain.configuration.Configuration parameters) throws Exception
invokeOperation in interface OperationFacetExceptionpublic OperationResult invokeOperation(String name, org.rhq.core.domain.configuration.Configuration parameters, org.mc4j.ems.connection.bean.EmsBean emsBean) throws Exception
ExceptionCopyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.