org.ow2.jasmine.probe.collectors
Class JCollectorService

java.lang.Object
  extended by org.ow2.jasmine.probe.collectors.JCollectorService
All Implemented Interfaces:
JasmineCollectorService

public abstract class JCollectorService
extends Object
implements JasmineCollectorService

Base class for Collector Service. It allows the management of the collectors of a given type corresponding to all the indicators of that type. It allows to find out the properties that must be defined in order to create an indicator of that type.

Author:
durieuxp, danesa

Field Summary
protected  JasmineCollectorInfo collectorInfo
          CollectorInfo unique object
protected  org.ow2.util.log.Log logger
          Logger.
protected  List<JasminePropertyInfo> properties
          Info about indicator Properties.
 
Constructor Summary
JCollectorService()
           
 
Method Summary
protected  void addCollector(String name, JCollector coll)
          Add a collector instance to the list of collectors corresponding to a given indicator.
abstract  JasmineCollector getCollector(JasmineIndicator indicator, JasmineProbe probe)
          Get the Collector corresponding to a JasmineIndicator.
protected  JCollector getCollector(String name, String probeId)
          Find a collector corresponding to a given indicator and probe
 JasmineCollectorInfo getCollectorInfo()
          Get the Information about the Collector
 List<String> getDependantIndicators(JasmineIndicator indic)
          Returns the List of indicators used by this indicator.
 List<String> getDependantTargets(JasmineIndicator indic)
          Returns the List of targets used by this indicator.
 List<JasminePropertyInfo> getPropertiesInfo()
          Deprecated.  
 String getType()
           
 void removeCollectors(String name, String probeId)
          Remove all the collectors (if name and probeId are both null) - called when the service stopped.
 void removeTarget(String name)
          Remove a target.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected org.ow2.util.log.Log logger
Logger.


properties

protected List<JasminePropertyInfo> properties
Info about indicator Properties. TODO Set an ArrayList to be conform to JasmineCollectorInfo (mapping issue ?) warning: the MXBean should be conform ! (ArrayList may cause problem)


collectorInfo

protected JasmineCollectorInfo collectorInfo
CollectorInfo unique object

Constructor Detail

JCollectorService

public JCollectorService()
Method Detail

getCollector

public abstract JasmineCollector getCollector(JasmineIndicator indicator,
                                              JasmineProbe probe)
                                       throws JasmineCollectorException
Get the Collector corresponding to a JasmineIndicator. Create it if necessary.

Specified by:
getCollector in interface JasmineCollectorService
Parameters:
indicator - the given indicator's definition
probe - the definition of the probe in which the indicator is used
Returns:
a Collector instance corresponding to the given indicator
Throws:
JasmineCollectorException

removeCollectors

public void removeCollectors(String name,
                             String probeId)
Remove all the collectors (if name and probeId are both null) - called when the service stopped. Remove all the collectors attached to a given indicator (name not null, probeId null) - called when an indicator is removed, or has changed. Remove the collector corresponding to a given indicator and a given probe.

Specified by:
removeCollectors in interface JasmineCollectorService
Parameters:
name - Indicator name
probeId - Probe identifier

removeTarget

public void removeTarget(String name)
Remove a target. This operation has no effect by on collector services which use implicit targets.

Specified by:
removeTarget in interface JasmineCollectorService
Parameters:
name - the name of the target to remove

addCollector

protected void addCollector(String name,
                            JCollector coll)
Add a collector instance to the list of collectors corresponding to a given indicator.

Parameters:
name - indicator name
coll - collector instance

getCollector

protected JCollector getCollector(String name,
                                  String probeId)
Find a collector corresponding to a given indicator and probe

Parameters:
name - indicator name
probeId - probe id
Returns:
return the first collector corresponding to the given indicator and probe

getPropertiesInfo

public List<JasminePropertyInfo> getPropertiesInfo()
Deprecated. 

Retrieve the description of all specific properties hidden in JasmineIndicator Return a Map of all properties with their description

Specified by:
getPropertiesInfo in interface JasmineCollectorService
Returns:
a Map of property descriptions

getCollectorInfo

public JasmineCollectorInfo getCollectorInfo()
Get the Information about the Collector

Specified by:
getCollectorInfo in interface JasmineCollectorService
Returns:
JasmineIndicatorTypeInfo

getDependantIndicators

public List<String> getDependantIndicators(JasmineIndicator indic)
Returns the List of indicators used by this indicator. This default version return an empty list.

Specified by:
getDependantIndicators in interface JasmineCollectorService
Parameters:
indic - JasmineIndicator
Returns:
Returns the List of indicators used by this indicator.

getDependantTargets

public List<String> getDependantTargets(JasmineIndicator indic)
Returns the List of targets used by this indicator. This default version return an empty list.

Specified by:
getDependantTargets in interface JasmineCollectorService
Parameters:
indic - JasmineIndicator
Returns:
Returns the List of targets used by this indicator.

getType

public String getType()


Copyright © 2013 OW2 Consortium. All Rights Reserved.