Class 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:
    1. A singleton instance, obtained through getInstance() or getInstance(io.helidon.config.Config). This instance is lazily initialized - the latest call that provides a config instance before a MetricRegistry.Type.BASE registry is obtained would be used to configure the base registry (as that is the only configurable registry in current implementation)
    2. A custom instance, obtained through create(Config) or create(). 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 Detail

      • getRegistryFactory

        @Deprecated
        public static Supplier<RegistryFactory> getRegistryFactory()
        Deprecated.
        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)
      • 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
      • getBridgeRegistry

        public io.helidon.common.metrics.InternalBridge.MetricRegistry getBridgeRegistry​(MetricRegistry.Type type)
        Description copied from interface: io.helidon.common.metrics.InternalBridge.MetricRegistry.RegistryFactory
        Returns the MicroProfile metric MetricRegistry of the indicated registry type typed as the internal abstraction.
        Specified by:
        getBridgeRegistry in interface io.helidon.common.metrics.InternalBridge.MetricRegistry.RegistryFactory
        Parameters:
        type - registry type selected
        Returns:
        MetricRegistry of the selected type