Class: AbstractInstantiator

AbstractInstantiator()

Abstract class of all instantiator implementations. An Instantiator will create an instance of a module. You cannot be sure, you get an actual instance of the object, since it could be possible to implement the module as e.g. rpc module which wraps an API. It will keep track of instances to react to circular dependencies.

Constructor

new AbstractInstantiator()

Author:
  • Wolfgang Felbermeier (@f3lang)
Source:

Methods

getInstance(path, config, root, requestId)

Will create a new instance of the requested module

Parameters:
Name Type Description
path string

The file path of the module

config object

The injection config resolved by the module analyzer

root string

The tree to work in

requestId string

The unique request id to identify circular dependencies

Source:

requestIsCircular(path, root, requestId) → {boolean}

Will check, if the current request has already visited this stage once.

Parameters:
Name Type Description
path string

The file path of the module

root string

The tree to work in

requestId string

The unique request id to identify circular dependencies

Source:
Returns:

true, if a circular dependency occurred.

Type
boolean