getOrProvide
Fetches an item for the given key.
If the key has not been previously registered, will create a new entry using putParams. If allowedScopes returns false for this ServiceLocator's scope, the created entry will come from ScopedServiceLocator.onInvalidScope.
Parameters
The ServiceKey for the desired service.
A predicate to check if the current ScopedServiceLocator.scope is valid for this provider.
The parameters needed to create a new ServiceEntry for key if one doesn't exist.
Fetches an item for the given key.
If an entry for the key has not been previously registered, it creates and stores a new one using the provider lambda. Creation is subject to the allowedScopes predicate; if the current scope is not allowed, this delegates to ScopedServiceLocator.onInvalidScope.
The multi-thread behavior depends on threadSafetyMode.
Parameters
The ServiceKey for the desired service.
A predicate to check if the current ScopedServiceLocator.scope is valid for this provider.
The thread safety mode for the lazy initialization.
A lambda that creates the service instance if one doesn't exist.