Class AbstractMBeanLoadMetric
- java.lang.Object
-
- org.jboss.modcluster.load.metric.impl.AbstractLoadMetric
-
- org.jboss.modcluster.load.metric.impl.AbstractMBeanLoadMetric
-
- All Implemented Interfaces:
LoadMetric
,LoadMetricMBean
- Direct Known Subclasses:
MBeanAttributeLoadMetric
,MBeanAttributeRatioLoadMetric
public abstract class AbstractMBeanLoadMetric extends AbstractLoadMetric
-
-
Field Summary
-
Fields inherited from interface org.jboss.modcluster.load.metric.LoadMetric
DEFAULT_CAPACITY, DEFAULT_WEIGHT
-
-
Constructor Summary
Constructors Constructor Description AbstractMBeanLoadMetric()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected <T> List<T>
getAttributes(String attribute, Class<T> targetClass)
protected abstract double
getLoad()
double
getLoad(Engine engine)
Returns the current load of this metric as a percent of the metric's capacity.void
setMBeanServer(MBeanServer server)
void
setPattern(String pattern)
void
setPattern(ObjectName pattern)
-
Methods inherited from class org.jboss.modcluster.load.metric.impl.AbstractLoadMetric
getCapacity, getWeight, setCapacity, setWeight
-
-
-
-
Method Detail
-
setPattern
public void setPattern(ObjectName pattern)
-
setPattern
public void setPattern(String pattern) throws MalformedObjectNameException
- Throws:
MalformedObjectNameException
-
setMBeanServer
public void setMBeanServer(MBeanServer server)
-
getAttributes
protected <T> List<T> getAttributes(String attribute, Class<T> targetClass) throws JMException
- Throws:
JMException
-
getLoad
public double getLoad(Engine engine) throws JMException
Description copied from interface:LoadMetric
Returns the current load of this metric as a percent of the metric's capacity.- Returns:
- raw load / capacity.
- Throws:
JMException
-
getLoad
protected abstract double getLoad() throws JMException
- Throws:
JMException
-
-