org.ow2.jasmine.probe.collectors.jmx.internal
Class JmxCollector

java.lang.Object
  extended by org.ow2.jasmine.probe.collectors.JCollector
      extended by org.ow2.jasmine.probe.collectors.jmx.internal.JmxCollectorBase
          extended by org.ow2.jasmine.probe.collectors.jmx.internal.JmxCollector
All Implemented Interfaces:
JasmineCollector

public class JmxCollector
extends JmxCollectorBase

Collector implementation for JMX. This implementation works with a separate thread used to pre-collect the results. Using a thread is interesting when we do not want to be stuck in case info cannot be got because the target is off.

Author:
durieuxp

Field Summary
 
Fields inherited from class org.ow2.jasmine.probe.collectors.jmx.internal.JmxCollectorBase
logger
 
Fields inherited from class org.ow2.jasmine.probe.collectors.JCollector
hostName, indicator, MISC_TARGET, NO_TARGET, period, probeId, probeManager
 
Constructor Summary
JmxCollector(String probeId, JasmineIndicator indicator, int period, String mbean, String csv)
          Constructor
 
Method Summary
 void addResult(List<Metric> metrics)
          Add a new result to the list.
 JasmineIndicatorValue getLastResult()
          Retrieve the last results for this indicator This method return a List of results in case indicator represents actually a list of values.
 boolean needResult()
          Check if this Collector needs a new result.
 void startPolling()
          Start polling
 void stopPolling()
          Stop polling
 
Methods inherited from class org.ow2.jasmine.probe.collectors.jmx.internal.JmxCollectorBase
getAttrlist, getJiv, getObjectName, getPattern, hasAttributes
 
Methods inherited from class org.ow2.jasmine.probe.collectors.JCollector
addJsr, addLongJsr, addLongValues, addValues, averageJsr, diffJsr, diffLongValues, diffValues, divideJsr, divideLongValues, divideValues, getDefaultTarget, getDomainName, getIndicator, getIndicatorName, getJsr, getProbeId, getServerName, isRemoved, jsrProps, longValue, maxJsr, minJsr, multiplyJsr, multiplyLongValues, multiplyValues, remove, setProbeManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmxCollector

public JmxCollector(String probeId,
                    JasmineIndicator indicator,
                    int period,
                    String mbean,
                    String csv)
Constructor

Parameters:
probeId - probe Identifier
indicator - JasmineIndicator definition
period - in seconds
mbean - MBean pattern
csv - CSV list of attributes
Method Detail

getLastResult

public JasmineIndicatorValue getLastResult()
                                    throws JasmineCollectorException
Retrieve the last results for this indicator This method return a List of results in case indicator represents actually a list of values.

Specified by:
getLastResult in interface JasmineCollector
Specified by:
getLastResult in class JCollector
Returns:
The constructed JasmineIndicatorValue
Throws:
JasmineCollectorException

stopPolling

public void stopPolling()
Stop polling

Specified by:
stopPolling in interface JasmineCollector
Specified by:
stopPolling in class JCollector

startPolling

public void startPolling()
Start polling

Specified by:
startPolling in interface JasmineCollector
Specified by:
startPolling in class JCollector

needResult

public boolean needResult()
Check if this Collector needs a new result. A stopped collector returns false. Otherwise, it returns true if there are nor metrics, or if metrics are out-dated regarding to the poll period.

Returns:
true if it needs one

addResult

public void addResult(List<Metric> metrics)
Add a new result to the list.

Parameters:
metrics -


Copyright © 2012 OW2 Consortium. All Rights Reserved.