const mixinafIoc::Registry
afIoc::Registry
@
Js
(Service) - The top level IoC object that holds service definitions and the root scope.
The Registry
instance may be dependency injected.
- activeScope
abstract Scope activeScope()
Returns the current active scope.
- defaultScope
abstract Scope defaultScope()
Returns the global default scope. This is the default scope used in any new thread and defaults to the root scope.
For normal IoC usage, consider using
activeScope()
instead.- printBanner
abstract Str printBanner()
Returns the Alien-Factory ASCII art banner. This is logged to standard out at registry startup. Remove the startup contribution to prevent the logging:
regBuilder.onRegistryStartup() |Configuration config| { config.remove("afIoc.logBanner") }
- printServices
abstract Str printServices()
Returns a pretty printed list of service definitions. This is logged to standard out at registry startup. Remove the startup contribution to prevent the logging:
regBuilder.onRegistryStartup() |Configuration config| { config.remove("afIoc.logServices") }
- rootScope
abstract Scope rootScope()
Returns the root scope.
For normal IoC usage, consider using
activeScope()
instead.- scopeDefs
abstract Str:ScopeDef scopeDefs()
Returns a map of all defined scopes, keyed by scope ID.
- serviceDefs
abstract Str:ServiceDef serviceDefs()
Returns a map of all defined services, keyed by service ID.
- setDefaultScope
abstract Scope setDefaultScope(Scope defaultScope)
For advanced use only.
Sets a new global default scope and returns the old one. Only non-threaded scopes may be set as the global default.
- shutdown
abstract This shutdown()
Destroys all active scopes and shuts down the registry.