Package io.helidon.metrics
Class RegistryFactory
- java.lang.Object
-
- io.helidon.metrics.RegistryFactory
-
- All Implemented Interfaces:
io.helidon.common.metrics.InternalBridge.MetricRegistry.RegistryFactory
public final class RegistryFactory extends Object implements io.helidon.common.metrics.InternalBridge.MetricRegistry.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.BASEregistry 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.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static RegistryFactorycreate()Create a new factory with default configuration, with pre-filledMetricRegistry.Type.VENDORandMetricRegistry.Type.BASEmetrics.static RegistryFactorycreate(Config config)Create a new factory with provided configuration, with pre filledMetricRegistry.Type.VENDORandMetricRegistry.Type.BASEmetrics.static RegistryFactorycreateSeFactory(Config config)Deprecated.usecreate()orcreate(io.helidon.config.Config)instead when a new registry factory instance is needed.io.helidon.common.metrics.InternalBridge.MetricRegistrygetBridgeRegistry(MetricRegistry.Type type)Returns the MicroProfile metricMetricRegistryof the indicated registry type typed as the internal abstraction.static RegistryFactorygetInstance()Get a singleton instance of the registry factory.static RegistryFactorygetInstance(Config config)Get a singleton instance of the registry factory for and update it with provided configuration.MetricRegistrygetRegistry(MetricRegistry.Type type)Get a registry based on its type.static Supplier<RegistryFactory>getRegistryFactory()Deprecated.useRegistryFactory::getInstanceinstead.
-
-
-
Method Detail
-
create
public static RegistryFactory create()
Create a new factory with default configuration, with pre-filledMetricRegistry.Type.VENDORandMetricRegistry.Type.BASEmetrics.- Returns:
- a new registry factory
-
create
public static RegistryFactory create(Config config)
Create a new factory with provided configuration, with pre filledMetricRegistry.Type.VENDORandMetricRegistry.Type.BASEmetrics.- Parameters:
config- configuration to use- Returns:
- a new registry factory
-
getRegistryFactory
@Deprecated public static Supplier<RegistryFactory> getRegistryFactory()
Deprecated.useRegistryFactory::getInstanceinstead.Get a supplier for registry factory. The supplier will return the singleton isntance that is created.- Returns:
- supplier of registry factory (to bind as late as possible)
-
createSeFactory
@Deprecated public static RegistryFactory createSeFactory(Config config)
Deprecated.usecreate()orcreate(io.helidon.config.Config)instead when a new registry factory instance is needed. UsegetInstance()orgetInstance(io.helidon.config.Config)to retrieve the shared (singleton) instance.Create a registry factory for systems without CDI.- Parameters:
config- configuration to load the factory config from- Returns:
- a new registry factory to obtain application registry (and other registries)
-
getInstance
public static RegistryFactory getInstance()
Get a singleton instance of the registry factory.- Returns:
- registry factory singleton
-
getInstance
public static RegistryFactory getInstance(Config config)
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.APPLICATIONandMetricRegistry.Type.VENDORreturns a modifiable registry, forMetricRegistry.Type.BASEreturns a final registry (cannot register new metrics).- Parameters:
type- type of registry- Returns:
- MetricRegistry for the type defined.
-
getBridgeRegistry
public io.helidon.common.metrics.InternalBridge.MetricRegistry getBridgeRegistry(MetricRegistry.Type type)
Description copied from interface:io.helidon.common.metrics.InternalBridge.MetricRegistry.RegistryFactoryReturns the MicroProfile metricMetricRegistryof the indicated registry type typed as the internal abstraction.- Specified by:
getBridgeRegistryin interfaceio.helidon.common.metrics.InternalBridge.MetricRegistry.RegistryFactory- Parameters:
type- registry type selected- Returns:
MetricRegistryof the selected type
-
-