- java.lang.Object
-
- io.helidon.metrics.RegistryFactory
-
- All Implemented Interfaces:
RegistryFactory
public class RegistryFactory extends Object implements RegistryFactory
Access point to all registries. There are two options to use the factory:- A singleton instance, obtained through
getInstance()
orgetInstance(io.helidon.config.Config)
. This instance is lazily initialized - the latest call that provides a config instance before aMetricRegistry.Type.BASE
registry is obtained would be used to configure the base registry (as that is the only configurable registry in current implementation) - A custom instance, obtained through
create(Config)
orcreate()
. This would create a new instance of a registry factory (in case multiple instances are desired), independent on the singleton instance and on other instances provided by these methods.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
RegistryFactory(MetricsSettings metricsSettings, Registry appRegistry, Registry vendorRegistry)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static RegistryFactory
create()
Deprecated, for removal: This API element is subject to removal in a future version.static RegistryFactory
create(Config config)
Deprecated, for removal: This API element is subject to removal in a future version.static RegistryFactory
getInstance()
Deprecated, for removal: This API element is subject to removal in a future version.static RegistryFactory
getInstance(Config config)
Deprecated, for removal: This API element is subject to removal in a future version.MetricRegistry
getRegistry(MetricRegistry.Type type)
Get a registry based on its type.void
update(MetricsSettings metricsSettings)
Updates the metrics settings for theRegistryFactory
.
-
-
-
Constructor Detail
-
RegistryFactory
protected RegistryFactory(MetricsSettings metricsSettings, Registry appRegistry, Registry vendorRegistry)
-
-
Method Detail
-
create
@Deprecated(since="2.4.0", forRemoval=true) public static RegistryFactory create()
Deprecated, for removal: This API element is subject to removal in a future version.Create a new factory with default configuration, with pre-filledMetricRegistry.Type.VENDOR
andMetricRegistry.Type.BASE
metrics.- Returns:
- a new registry factory
-
create
@Deprecated(since="2.4.0", forRemoval=true) public static RegistryFactory create(Config config)
Deprecated, for removal: This API element is subject to removal in a future version.Create a new factory with provided configuration, with pre filledMetricRegistry.Type.VENDOR
andMetricRegistry.Type.BASE
metrics.- Parameters:
config
- configuration to use- Returns:
- a new registry factory
-
getInstance
@Deprecated(since="2.4.0", forRemoval=true) public static RegistryFactory getInstance()
Deprecated, for removal: This API element is subject to removal in a future version.Get a singleton instance of the registry factory.- Returns:
- registry factory singleton
-
getInstance
@Deprecated(since="2.4.0", forRemoval=true) public static RegistryFactory getInstance(Config config)
Deprecated, for removal: This API element is subject to removal in a future version.Get a singleton instance of the registry factory for and update it with provided configuration. Note that the config is used only if nobody access the base registry.- Parameters:
config
- configuration of the registry factory used to update behavior of the instance returned- Returns:
- registry factory singleton
-
getRegistry
public MetricRegistry getRegistry(MetricRegistry.Type type)
Get a registry based on its type. ForMetricRegistry.Type.APPLICATION
andMetricRegistry.Type.VENDOR
returns a modifiable registry, forMetricRegistry.Type.BASE
returns a final registry (cannot register new metrics).- Specified by:
getRegistry
in interfaceRegistryFactory
- Parameters:
type
- type of registry- Returns:
- MetricRegistry for the type defined.
-
update
public void update(MetricsSettings metricsSettings)
Description copied from interface:RegistryFactory
Updates the metrics settings for theRegistryFactory
.Reserved for use by internal Helidon code.
- Specified by:
update
in interfaceRegistryFactory
- Parameters:
metricsSettings
- metrics settings to use in updating the factory
-
-