java.lang.Object
io.helidon.metrics.RegistryFactory
- All Implemented Interfaces:
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
ModifierConstructorDescriptionprotected
RegistryFactory
(MetricsSettings metricsSettings, Registry appRegistry, Registry vendorRegistry) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic RegistryFactory
create()
Deprecated, for removal: This API element is subject to removal in a future version.static RegistryFactory
Deprecated, for removal: This API element is subject to removal in a future version.static RegistryFactory
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.Get a registry based on its type.void
update
(MetricsSettings metricsSettings) Updates the metrics settings for theRegistryFactory
.
-
Constructor Details
-
RegistryFactory
protected RegistryFactory(MetricsSettings metricsSettings, Registry appRegistry, Registry vendorRegistry) Create a new instance.- Parameters:
metricsSettings
- metrics setting to use in preparing the registry factoryappRegistry
- application registry to provide from the factoryvendorRegistry
- vendor registry to provide from the factory
-
-
Method Details
-
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, 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, 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
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
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
-
RegistryFactory.create()