Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DefaultCountersFactory

Creates ICounters components by their descriptors.

see

Factory

see

NullCounters

see

LogCounters

see

CompositeCounters

Hierarchy

Implements

Index

Constructors

constructor

Properties

Static CompositeCountersDescriptor

CompositeCountersDescriptor: Descriptor = new Descriptor("pip-services", "counters", "composite", "*", "1.0")

Static Descriptor

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

Static LogCountersDescriptor

LogCountersDescriptor: Descriptor = new Descriptor("pip-services", "counters", "log", "*", "1.0")

Static NullCountersDescriptor

NullCountersDescriptor: Descriptor = new Descriptor("pip-services", "counters", "null", "*", "1.0")

Methods

canCreate

  • canCreate(locator: any): any
  • Checks if this factory is able to create component by given locator.

    This method searches for all registered components and returns a locator for component it is able to create that matches the given locator. If the factory is not able to create a requested component is returns null.

    Parameters

    • locator: any

      a locator to identify component to be created.

    Returns any

    a locator for a component that the factory is able to create.

create

  • create(locator: any): any
  • Creates a component identified by given locator.

    throws

    a CreateException if the factory is not able to create the component.

    Parameters

    • locator: any

      a locator to identify component to be created.

    Returns any

    the created component.

register

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

    Parameters

    • locator: any

      a locator to identify component to be created.

    • factory: function

      a factory function that receives a locator and returns a created component.

        • (locator: any): any
        • Parameters

          • locator: any

          Returns any

    Returns void

registerAsType

  • registerAsType(locator: any, type: any): void
  • Registers a component using its type (a constructor function).

    Parameters

    • locator: any

      a locator to identify component to be created.

    • type: any

      a component type.

    Returns void

Generated using TypeDoc