Class MonitoringDataProvider
java.lang.Object
org.jppf.management.diagnostics.provider.MonitoringDataProvider
- Direct Known Subclasses:
DefaultMonitoringDataProvider
Base class for pluggable providers of monitoring data.
Concrete implementations must have a no-args constructor.
- Author:
- Laurent Cohen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidPerform the definition of the properties supplied by this provider.Get the mappings of property names to their associted converter, if any.protected StringGet the base path to the localization bundles for this provider.Get the properties defined for this provider.JPPFProperty<?>getProperty(String name) Get the property with the specified name.abstract TypedPropertiesGet the values for the defined properties.abstract voidinit()Perform the initialization of this provider.removeProperty(String name) Remove the specified property.removeProperty(JPPFProperty<?> property) Remove the specified property.setBooleanProperty(String name, boolean defaultValue) Add a boolean property.setConverter(String name, MonitoringValueConverter converter) Associate a value converter to the specified property.setDoubleProperty(String name, double defaultValue) Add a double property.setDoubleProperty(String name, double defaultValue, double minValue, double maxValue) Add a double property.setFloatProperty(String name, float defaultValue) Add a float property.setFloatProperty(String name, float defaultValue, float minValue, float maxValue) Add a float property.setIntProperty(String name, int defaultValue) Add an integer property.setIntProperty(String name, int defaultValue, int minValue, int maxValue) Add an integer property.setLongProperty(String name, long defaultValue) Add a long property.setLongProperty(String name, long defaultValue, long minValue, long maxValue) Add a long property.setStringProperty(String name, String defaultValue) Add a String property.
-
Constructor Details
-
MonitoringDataProvider
public MonitoringDataProvider()
-
-
Method Details
-
defineProperties
public abstract void defineProperties()Perform the definition of the properties supplied by this provider. This method is called extactly once in both producer (where the data comes from) and consumer (where the data is rendered, e.g. admin console) sides. -
init
public abstract void init()Perform the initialization of this provider. This method is called exactly once on the producer (where the data comes from) side only. -
getValues
Get the values for the defined properties.This method is expected to be called repeatedly on the producer side (where the data comes from).
- Returns:
- the values as a
TypedPropertiesobject, mapping the properties names to their value as aString.
-
getLocalizationBase
Get the base path to the localization bundles for this provider. For exemple, if the base path ismypackage.MyProps, then the packahemypackageshould at least contain the fileMyProps.properties, along with other localized bundles such asMyProps_fr.properties,MyProps_en_GB.properties, etc.This default implementation returns
null. It should be overriden to provide a different value.- Returns:
- the base path to the localization bundles for this provider.
- See Also:
-
setIntProperty
Add an integer property. If a property with the same name already exists, it is replaced.- Parameters:
name- the name of the property.defaultValue- the default value.- Returns:
- this provider, for method call chaining.
-
setIntProperty
public MonitoringDataProvider setIntProperty(String name, int defaultValue, int minValue, int maxValue) Add an integer property. If a property with the same name already exists, it is replaced.- Parameters:
name- the name of the property.defaultValue- the default value.minValue- the minimum accepted value for this property.maxValue- the maximum accepted value for this property.- Returns:
- this provider, for method call chaining.
-
setLongProperty
Add a long property. If a property with the same name already exists, it is replaced.- Parameters:
name- the name of the property.defaultValue- the default value.- Returns:
- this provider, for method call chaining.
-
setLongProperty
public MonitoringDataProvider setLongProperty(String name, long defaultValue, long minValue, long maxValue) Add a long property. If a property with the same name already exists, it is replaced.- Parameters:
name- the name of the property.defaultValue- the default value.minValue- the minimum accepted value for this property.maxValue- the maximum accepted value for this property.- Returns:
- this provider, for method call chaining.
-
setFloatProperty
Add a float property. If a property with the same name already exists, it is replaced.- Parameters:
name- the name of the property.defaultValue- the default value.- Returns:
- this provider, for method call chaining.
-
setFloatProperty
public MonitoringDataProvider setFloatProperty(String name, float defaultValue, float minValue, float maxValue) Add a float property. If a property with the same name already exists, it is replaced.- Parameters:
name- the name of the property.defaultValue- the default value.minValue- the minimum accepted value for this property.maxValue- the maximum accepted value for this property.- Returns:
- this provider, for method call chaining.
-
setDoubleProperty
Add a double property. If a property with the same name already exists, it is replaced.- Parameters:
name- the name of the property.defaultValue- the default value.- Returns:
- this provider, for method call chaining.
-
setDoubleProperty
public MonitoringDataProvider setDoubleProperty(String name, double defaultValue, double minValue, double maxValue) Add a double property. If a property with the same name already exists, it is replaced.- Parameters:
name- the name of the property.defaultValue- the default value.minValue- the minimum accepted value for this property.maxValue- the maximum accepted value for this property.- Returns:
- this provider, for method call chaining.
-
setBooleanProperty
Add a boolean property. If a property with the same name already exists, it is replaced.- Parameters:
name- the name of the property.defaultValue- the default value.- Returns:
- this provider, for method call chaining.
-
setStringProperty
Add a String property. If a property with the same name already exists, it is replaced.- Parameters:
name- the name of the property.defaultValue- the default value.- Returns:
- this provider, for method call chaining.
-
getProperty
Get the property with the specified name.- Parameters:
name- the name of the property to lookup.- Returns:
- a
JPPFPropertyinstance, ornullif there is no property with the specified name.
-
removeProperty
Remove the specified property. If a property with the same name already exists, it is replaced.- Parameters:
name- the name of the property to remove.- Returns:
- this provider, for method call chaining.
-
removeProperty
Remove the specified property.- Parameters:
property- the property to remove.- Returns:
- this provider, for method call chaining.
-
getProperties
Get the properties defined for this provider.- Returns:
- a collection of the defined properties.
-
setConverter
Associate a value converter to the specified property. If either the property name or the converter isnull, then this method has no effect.- Parameters:
name- the name of the property to remove.converter- the value converter to associate with the property.- Returns:
- this provider, for method call chaining.
-
getConverters
Get the mappings of property names to their associted converter, if any.- Returns:
- a
Mapof string property names to their associatedMonitoringValueConverter.
-