ManagedReferences class
Managed references that in addition to keeping and locating references can also manage their lifecycle:
- Auto-creation of missing component using available factories
- Auto-linking newly added components
- Auto-opening newly added components
- Auto-closing removed components
See RunReferencesDecorator See LinkReferencesDecorator See BuildReferencesDecorator See References (in the PipServices "Commons" package)
- Inheritance
- Object
- ReferencesDecorator
- ManagedReferences
- Implemented types
- Implementers
Constructors
- ManagedReferences(List tuples)
- Creates a new instance of the references [...]
Properties
- builder ↔ BuildReferencesDecorator
-
read / write
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- linker ↔ LinkReferencesDecorator
-
read / write
- nextReferences ↔ IReferences
-
The next references or decorator in the chain.
read / write, inherited
- references ↔ References
-
read / write
- runner ↔ RunReferencesDecorator
-
read / write
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
- topReferences ↔ IReferences
-
The decorator at the top of the chain.
read / write, inherited
Methods
-
close(
String correlationId) → Future -
Closes component and frees used resources. [...]
override
-
find<
T> (dynamic locator, bool required) → List< T> -
Gets all component references that match specified locator. [...]
inherited
-
getAll(
) → List -
Gets all component references registered in this reference map. [...]
inherited
-
getAllLocators(
) → List -
Gets locators for all registered component references in this reference map. [...]
inherited
-
getOneOptional<
T> (dynamic locator) → T -
Gets an optional component reference that matches specified locator. [...]
inherited
-
getOneRequired<
T> (dynamic locator) → T -
Gets a required component reference that matches specified locator. [...]
inherited
-
getOptional<
T> (dynamic locator) → List< T> -
Gets all component references that match specified locator. [...]
inherited
-
getRequired<
T> (dynamic locator) → List< T> -
Gets all component references that match specified locator.
At least one component reference must be present.
If it doesn't the method throws an error. [...]
inherited
-
isOpen(
) → bool -
Checks if the component is opened. [...]
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
open(
String correlationId) → Future -
Opens the component. [...]
override
-
put(
dynamic locator, dynamic component) → dynamic -
Puts a new reference into this reference map. [...]
inherited
-
remove(
dynamic locator) → dynamic -
Removes a previously added reference that matches specified locator.
If many references match the locator, it removes only the first one.
When all references shall be removed, use removeAll method instead. [...]
inherited
-
removeAll(
dynamic locator) → List -
Removes all component references that match the specified locator. [...]
inherited
-
toString(
) → String -
Returns a string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator. [...]
inherited
Static Methods
-
fromTuples(
List tuples) → ManagedReferences - Creates a new ManagedReferences object filled with provided key-value pairs called tuples. Tuples parameters contain a sequence of locator1, component1, locator2, component2, ... pairs. [...]