Resolves a service by capability token.
On a multi-provider token this returns the FIRST registered provider; use
IServiceRegistry.getAll to reach all of them.
The expected service type
The capability token to resolve
The registered service
Resolves every provider registered for a multi-provider token.
The expected service type
The capability token to resolve
All registered providers, in registration order; empty when none
Reports whether a capability is available.
The capability token to look up
true if at least one provider is registered
OptionalisReports whether a known instance is the CURRENT provider a resolving
get would select for a token — WITHOUT resolving it.
This is a non-resolving identity check: it compares the supplied instance
against the registration get would choose (own single registration, then
own first multi-provider, then the parent) and returns a boolean. It never
invokes a lazy factory, never returns the current service, and never
enumerates the registry. A token whose selected registration is a factory
that has not yet run answers false, not the parent's instance: "present
but never constructed" must not be mistaken for a foreign provider.
The method is OPTIONAL so that third-party registry-shaped test doubles and
request-scoped contexts that predate it keep compiling. A consumer that
needs a current-provider check must treat an absent isCurrent as "cannot
verify" rather than falling back to get, which would instantiate a lazy
replacement.
The service's interface type
The capability token to check
The instance to compare against the current registration
true only when instance IS the registration get would select
Registers a service instance under a capability token.
The service type
The capability token to register under
The service instance
Optionaloptions: RegisterOptions
Override and multi-provider behavior
Registers a lazy factory: the service is instantiated on first
get and cached for subsequent lookups.
The service type
The capability token to register under
Factory invoked once, on first lookup
Optionaloptions: RegisterOptions
Override and multi-provider behavior
Removes a registration. On a multi-provider token this removes EVERY provider registered under it, not just the first.
The capability token to remove
true if a registration was removed
Maps capability tokens to service instances.
The registry is the framework's primary service resolution mechanism; the optional DI container is a convenience layer on top of it. The application registry is sealed after
runBootstrap(); request-scoped services are registered on the request context instead.Example
Since
0.1.0