Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DefaultPrometheusFactory

Creates Prometheus components by their descriptors.

see

Factory

see

PrometheusCounters

see

PrometheusMetricsService

Hierarchy

  • Factory
    • DefaultPrometheusFactory

Implements

  • IFactory

Index

Constructors

constructor

Properties

Static Descriptor

Descriptor: Descriptor = new Descriptor("pip-services", "factory", "prometheus", "default", "1.0")

Static PrometheusCountersDescriptor

PrometheusCountersDescriptor: Descriptor = new Descriptor("pip-services", "counters", "prometheus", "*", "1.0")

Static PrometheusMetricsServiceDescriptor

PrometheusMetricsServiceDescriptor: Descriptor = new Descriptor("pip-services", "metrics-service", "prometheus", "*", "1.0")

Methods

canCreate

  • canCreate(locator: any): any
  • Checks if the factory contains the given locator.

    Parameters

    • locator: any

      the locator to search for in this factory.

    Returns any

    the locator that was found or null otherwise.

create

  • create(locator: any): any
  • Creates an object using the given locator.

    throws

    a CreateException if it fails to create an object using the given locator.

    Parameters

    • locator: any

      the locator of the factory that needs to be called.

    Returns any

    the object that was created by the factory with the given locator.

register

  • register(locator: any, factory: function): void
  • Registers a factory.

    Example factory:

    (locator) => { return new myClass(); }
    
    throws

    Error, when locator or factory parameters are null.

    Parameters

    • locator: any

      the locator that is used to identify the factory. Cannot be null.

    • factory: function

      the factory to add. Cannot be null.

        • (locator: any): any
        • Parameters

          • locator: any

          Returns any

    Returns void

registerAsType

  • registerAsType(locator: any, objectFactory: any): void
  • Registers a factory that can create instances of 'objectFactory' classes.

    throws

    Error, when locator or factory parameters are null.

    Parameters

    • locator: any

      the locator that is used to identify the object factory. Cannot be null.

    • objectFactory: any

      the object type that can be created by this factory. Cannot be null.

    Returns void

Generated using TypeDoc