ServiceDescriptor class abstract
Abstract factory-like service creator and information holder.
This class is mostly generated in end-user applications by darwin_gen or the generators of other darwin packages. However this class can and should also be manually implemented by plugins which intend to run custom services.
- Implementers
- Available extensions
Constructors
- ServiceDescriptor()
-
const
Properties
- bindingType → Type
-
Type to which this service is going to get bound to.
no setter
-
conditions
→ List<
Condition> -
Conditions required by this service.
no setter
-
dependencies
→ List<
InjectorKey> -
Dependencies required by this service.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- optional → bool
-
Defines if this service is optional and can be skipped.
no setter
-
optionalDependencies
→ List<
InjectorKey> -
Optional dependencies of this service.
no setter
-
publications
→ List<
InjectorKey> -
All dependencies which could be published by this service.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serviceType → Type
-
Actual type of the service that will be instantiated
no setter
Methods
-
collectDependencies(
) → Iterable< InjectorKey> -
Available on ServiceDescriptor, provided by the ResolutionExtension extension
Collects all required dependencies of this service and its conditions. -
collectOptionalDependencies(
) → Iterable< InjectorKey> -
Available on ServiceDescriptor, provided by the ResolutionExtension extension
Collects all optional dependencies of this service and its conditions. -
instantiate(
Injector injector) → Future -
inherited
-
isSatisfied(
Injector injector) → bool -
Available on ServiceDescriptor, provided by the ResolutionExtension extension
Verifies if theinjector
provides all required dependencies. -
isSolvable(
Injector injector, List< InjectorKey> futurePromises) → bool -
Available on ServiceDescriptor, provided by the ResolutionExtension extension
Verifies if all required dependencies are either already provided by theinjector
or could still become available as promised byfuturePromises
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
skipDependencyCycle(
Injector injector, List< InjectorKey> futurePromises) → bool -
Available on ServiceDescriptor, provided by the ResolutionExtension extension
Returns if the DarwinSystemServiceMixin should wait another dependency cycle before trying to create this service, either because it is currently lacking required dependencies, or optional dependencies are still being possibly promised byfuturePromises
. -
start(
DarwinSystem system, dynamic obj) → Future< void> - The start signal handler of this service.
-
stop(
DarwinSystem system, dynamic obj) → Future< void> - The stop signal handler of this service.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
create(
Type serviceType, FutureOr instantiate(Injector), {Type? bindingType, bool optional = false, List< InjectorKey> publications = const [], List<InjectorKey> dependencies = const [], List<InjectorKey> optionalDependencies = const [], List<Condition> conditions = const [], FutureOr<void> start(DarwinSystem, dynamic)?, FutureOr<void> stop(DarwinSystem, dynamic)?}) → ServiceDescriptor