RunReferencesDecorator class

References decorator that automatically opens to newly added components that implement IOpenable interface and closes removed components that implement IClosable interface.

Inheritance

Constructors

RunReferencesDecorator(IReferences nextReferences, IReferences topReferences)
Creates a new instance of the decorator.

Properties

hashCode int
The hash code for this object.
no setterinherited
nextReferences ↔ IReferences?
The next references or decorator in the chain.
getter/setter pairinherited
opened bool
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
topReferences ↔ IReferences?
The decorator at the top of the chain.
getter/setter pairinherited

Methods

close(String? correlationId) Future
Closes component and frees used resources.
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.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
open(String? correlationId) Future
Opens the component.
put(dynamic locator, dynamic component) → void
Puts a new reference into this reference map.
override
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.
override
removeAll(dynamic locator) List
Removes all component references that match the specified locator.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited