AbstractPodProviderFactory class abstract
Retrieves the PodProvider backing a pod.
This hook is responsible for validating and casting the pod instance into a usable PodProvider.
Default Behavior
- Verifies that
instanceis a PodProvider. - If not, throws a PodCreationException (invalid configuration).
Extension
- Override this method in subclasses if pods can wrap or proxy providers in non-standard ways.
Parameters
podName: Logical pod identifier.instance: The actual pod object (expected to be a PodProvider).
Returns
The validated PodProvider.
- Inheritance
-
- Object
- SimpleAliasRegistry
- AbstractPodProviderFactory
- Implemented types
Constructors
- AbstractPodProviderFactory()
- Retrieves the PodProvider backing a pod.
Properties
- aliasCount → int
-
Returns the number of registered aliases for the current thread.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
Returns true if no aliases are registered for the current thread.
no setterinherited
- isNotEmpty → bool
-
Returns true if aliases are registered for the current thread.
no setterinherited
- logger → Log
-
Logger instance for tracking pod factory operations, errors, and diagnostic information.
no setter
-
POD_PROVIDER_CLASS
→ Class<
PodProvider> -
The PodProvider class reference for internal usage.
final
-
podProviderInstanceCache
→ Map<
String, ObjectHolder< Object> > -
Retrieves the PodProvider backing a pod.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
singletonCallbacks
→ Map<
String, Consumer< Object> > -
Map of singleton callbacks: pod name to Consumer.
finalinherited
-
threadLocalAliasMap
→ Map<
String, String> -
Gets the thread-local alias map for testing or advanced use cases.
no setterinherited
-
threadLocalAliasNames
→ List<
String> -
Gets the thread-local alias names list for testing or advanced use cases.
no setterinherited
Methods
-
addSingleton(
String name, {ObjectHolder< Object> ? object, ObjectFactory<Object> ? factory}) → Future<void> -
Add the given singleton object to the singleton cache of this factory.
inherited
-
addSingletonCallback(
String name, Class type, Consumer< Object> callback) → void -
Add a callback to be executed when the singleton associated with
nameis initialized.inherited -
afterSingletonCreation(
String name) → void -
Callback after singleton creation.
inherited
-
allowAliasOverriding(
) → bool -
Determine whether alias overriding is allowed.
inherited
-
beforeSingletonCreation(
String name) → void -
Callback before singleton creation.
inherited
-
checkForAliasCircle(
String name, String alias) → void -
Check whether the given name points back to the given alias as an alias
in the other direction already, catching a circular reference.
inherited
-
clear(
) → void -
Clears all alias registrations for the current thread.
inherited
-
clearSingletonCache(
) → void - Clear all cached singleton instances in this registry.
-
containsSingleton(
String name) → bool -
Returns
trueif this registry contains a pod with the givenname.inherited -
destroyDependentPods(
String name) → Future< void> -
Destroy all pods that depend on the specified pod.
inherited
-
destroyPod(
String name, Object pod) → Future< void> -
Destroy the given pod.
inherited
-
destroySingleton(
String name) → Future< void> -
Destroy the given pod. Delegates to destroyPod if a corresponding disposable pod instance is found.
inherited
-
destroySingletons(
) → Future< void> -
Destroy all singleton pods in this registry.
inherited
-
doGetSingleton(
String name, {bool allowEarlyReference = true, ObjectFactory< Object> ? factory}) → Future<TypedInstance?> -
Get the singleton instance for the given name.
inherited
-
getAlias(
String name) → String? -
Retrieves the primary name associated with the given
alias.inherited -
getAliases(
String name) → List< String> -
Retrieves all aliases registered for the given primary
name.inherited -
getAliasNames(
) → List< String> -
Returns all registered aliases as an unmodifiable view for the current thread.
inherited
-
getDependenciesForPod(
String name) → List< String> -
Return the names of all pods that the specified pod depends on, if any.
inherited
-
getDependentPods(
String name) → List< String> -
Return the names of all pods which depend on the specified pod, if any.
inherited
-
getNullableProviderObject(
String name) → ObjectHolder< Object> ? - Returns the cached raw object for a provider-managed pod, if present.
-
getPodProvider(
String podName, Object instance) → PodProvider - Retrieves the PodProvider backing a pod.
-
getProviderObject(
PodProvider provider, Class? type, String name, bool shouldPostProcess) → Future< ObjectHolder< Object> > - Retrieves the object managed by a PodProvider, applying caching and optional post-processing semantics.
-
getSingleton(
String name, {bool allowEarlyReference = true, ObjectFactory< Object> ? factory}) → Future<Object?> -
Retrieve the pod registered under
name.inherited -
getSingletonCache(
String name, [bool allowEarlyReference = true]) → Future< ObjectHolder< Object> ?> -
inherited
-
getSingletonClass(
String name) → Class? -
Return the class of the specified singleton pod, if any.
inherited
-
getSingletonCount(
) → int -
Returns the total number of pods registered.
inherited
-
getSingletonNames(
) → List< String> -
Returns a list of all pod names currently registered.
inherited
-
getUltimateNames(
) → List< String> -
Returns all registered target names as an unmodifiable view for the current thread.
inherited
-
hasAlias(
String name, String alias) → bool -
Determine whether the given name has the given alias registered.
inherited
-
hasDependentPod(
String name) → bool -
Determine whether a dependent pod has been registered for the given name.
inherited
-
isActuallyInCreation(
String name) → bool -
Check whether the specified singleton pod is actually in creation.
inherited
-
isAlias(
String name) → bool -
Checks whether the given
nameis registered as an alias.inherited -
isCurrentlyCreatingSingleton(
String name) → bool -
Check whether the specified singleton pod is currently in creation.
inherited
-
isCurrentlyInCreation(
String name) → bool -
Check whether the specified singleton pod is currently in creation.
inherited
-
isDependent(
String name, String dependentName) → bool -
Determine whether the specified dependent pod has been registered as
dependent on the given pod or on any of its transitive dependencies.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onSuppressedException(
Exception ex) → void -
Handle a suppressed exception.
inherited
-
postProcessObjectFromPodProvider(
ObjectHolder< Object> object, String name) → Future<ObjectHolder< Object> > - Retrieves the PodProvider backing a pod.
-
registerAlias(
String name, String alias) → void -
Registers an alias for an existing name in the registry.
inherited
-
registerContainedPod(
String child, String parent) → void -
Register a containment relationship between two pods.
inherited
-
registerDependentPod(
String name, String dependentName) → void -
Register a dependent pod for the given pod.
inherited
-
registerDisposablePod(
String name, DisposablePod pod, [String? qualifiedName]) → void -
Register a disposable pod for the given pod name.
inherited
-
registerSingleton(
String name, Class type, {ObjectHolder< Object> ? object, ObjectFactory<Object> ? factory}) → Future<void> -
Register a new
podunder the givenname. -
removeAlias(
String alias) → void -
Removes an alias from the registry.
inherited
-
removeSingleton(
String name) → void -
Remove the pod associated with
name. -
resolveAliases(
String valueResolver(String)) → void -
Resolve all alias target names and aliases registered in this registry,
applying the given StringValueResolver to them.
inherited
-
setCurrentlyInCreation(
String name, bool inCreation) → void -
Set the specified singleton pod as currently in creation.
inherited
-
targetName(
String name) → String -
Determine the target name, resolving aliases to their ultimate target.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited