# AbstractAutowirePodFactory class abstract

Abstract base class for pod factories that support autowiring capabilities.

This class provides the foundation for dependency injection with autowiring support, handling circular references, definition overriding, and pod lifecycle management. It implements the core autowiring logic for Jetleaf framework.

{@macro autowire_pod_factory_usage}

Example usage:

    class MyAutowirePodFactory extends AbstractAutowirePodFactory {
      @override
      Future<Object?> doResolveDependency(DependencyDescriptor descriptor) async {
        // Custom dependency resolution logic
        return await resolveDependencyFromRegistry(descriptor);
      }
    }

    final factory = MyAutowirePodFactory();
    await factory.initialize();

    // Create a pod with autowiring
    final myService = await factory.autowire(MyService, AutowireMode.BY_TYPE);

Inheritance
  - Object
  - SimpleAliasRegistry
  - AbstractPodProviderFactory
  - AbstractPodFactory
  - AbstractAutowirePodFactory
Implemented types
  - AutowirePodFactory
  - SingletonPodRegistry

## Constructors

AbstractAutowirePodFactory.new([PodFactory? parentFactory])
  Abstract base class for pod factories that support autowiring capabilities.

## Properties

aliasCount → int
  Returns the number of registered aliases for the current thread.
  no setter inherited
hashCode → int
  The hash code for this object.
  no setter inherited
isEmpty → bool
  Returns true if no aliases are registered for the current thread.
  no setter inherited
isNotEmpty → bool
  Returns true if aliases are registered for the current thread.
  no setter inherited
logger → Log
  Logger for this class.
  final
POD_PROVIDER_CLASS → Class<PodProvider>
  The PodProvider class reference for internal usage.
  final inherited
podProviderInstanceCache → Map<String, ObjectHolder<Object>>
  Retrieves the PodProvider backing a pod.
  final inherited
runtimeType → Type
  A representation of the runtime type of the object.
  no setter inherited
singletonCallbacks → Map<String, Consumer<Object>>
  Map of singleton callbacks: pod name to Consumer.
  final inherited
threadLocalAliasMap → Map<String, String>
  Gets the thread-local alias map for testing or advanced use cases.
  no setter inherited
threadLocalAliasNames → List<String>
  Gets the thread-local alias names list for testing or advanced use cases.
  no setter inherited

## Methods

addPodProcessor(PodProcessor processor) → void
  Registers a new pod-aware processor.
  inherited
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 `name` is initialized.
  inherited
afterPrototypeCreation(String name) → void
  Removes a prototype pod from the creation tracking after creation completes.
  inherited
afterSingletonCreation(String name) → void
  Callback after singleton creation.
  inherited
allowAliasOverriding() → bool
  Determine whether alias overriding is allowed.
  inherited
applyAfterInitializationProcessing(Object existing, String podName, Class type) → Future<Object>
  Applies post-processing to a pod instance after its initialization.
applyAfterInstantiationProcessing(Object existing, String podName, Class type) → Future<Object>
  Applies post-processing to a pod instance after its instantiation.
applyBeforeInitializationProcessing(Object existing, String podName, Class type) → Future<Object>
  Applies post-processing to a pod instance after its initialization.
applyBeforeInstantiationProcessing(String podName, PodDefinition root) → Future<Object?>
  Applies post-processing to a pod instance before its initialization.
applyCustomPostProcessing(Object object, String name) → Object
  Applies custom post-processing logic to an object from a PodProvider.
applyPodPropertyValues(Object existing, String name) → Future<void>
  Applies property values to a pod instance based on its configuration.
  override
applyPropertyValues(String podName, RootPodDefinition root, PodHolder ph, MutablePropertyValues pvs) → void
  Applies property values to the pod instance.
autowire(Class podClass, int autowireMode, bool checkDependency) → Future<Object>
  Creates and autowires a new pod instance from a class.
  override
autowireByName(String podName, RootPodDefinition root, PodHolder ph, MutablePropertyValues pvs) → Future<void>
  Performs autowiring by name for the pod instance.
autowireByType(String podName, RootPodDefinition root, PodHolder ph, MutablePropertyValues pvs) → Future<void>
  Performs autowiring by type for the pod instance.
autowirePod(Object existing, Class type, {int? autowireMode, bool? checkDependency}) → Future<void>
  Performs autowiring on an existing pod instance.
  override
beforePrototypeCreation(String name) → void
  Marks a prototype pod as being created to detect circular dependencies.
  inherited
beforeSingletonCreation(String name) → void
  Callback before singleton creation.
  inherited
cacheMergedPodDefinition(RootPodDefinition root, String name) → void
  Caches a merged pod definition for a given pod name.
  inherited
checkDependencies(String podName, RootPodDefinition root, PodHolder ph, MutablePropertyValues pvs) → void
  Checks if all dependencies are satisfied for the pod instance.
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
checkMergedPodDefinition(RootPodDefinition root, String name, Object? args) → void
  Checks the merged pod definition for a given pod name.
  inherited
cleanupAfterPodCreationFailure(String name) → void
  Cleans up after a pod creation failure.
  inherited
clear() → void
  Clears all alias registrations for the current thread.
  inherited
clearMergedPodDefinition(String name) → void
  Clears the merged pod definition for a given pod name.
  inherited
clearMetadataCache() → void
  Clears the metadata cache for pods that are not eligible for caching.
  inherited
clearSingletonCache() → void
  Clear all cached singleton instances in this registry.
  override
configurePod(Object existing, String name) → Future<Object>
  Configures a pod instance with factory-specific settings.
  override
containsDefinition(String name) → bool
  Check if pod definition exists locally.
  inherited
containsLocalPod(String name) → Future<bool>
  Checks if a pod with the given name is registered locally in this factory.
  inherited
containsPod(String name) → Future<bool>
  Checks if a pod with the given name is registered in the factory.
  inherited
containsSingleton(String name) → bool
  Returns `true` if this registry contains a pod with the given `name`.
  inherited
containsType(Class type, [bool allowPodProviderInit = false]) → Future<bool>
  Checks if the factory contains a pod of the specified type.
  inherited
convertIfNecessary<T>(String name, Object pod, [Class? type, Class? source]) → T
  Converts a pod instance to the required type if necessary.
  inherited
convertValueIfNecessary(Object? value, Class target, Class? source) → Object?
  Convert a given `value` into the specified `targetType` if necessary.
copyConfigurationFrom(ConfigurablePodFactory otherFactory) → void
  Copies configuration from another factory.
  override
create(String podName, RootPodDefinition root, List<ArgumentValue>? args) → Future<Object>
  Creates a pod instance with the given name and definition.
createInstance(String podName, RootPodDefinition root, List<ArgumentValue>? args) → Future<PodHolder>
  Creates a pod instance using the appropriate strategy (factory method, constructor, or default instantiation).
createPod<T>(T instance, Class type) → Future<T>
  Creates and registers a pod from an existing instance.
  override
destroyDependentPods(String name) → void
  Destroy all pods that depend on the specified pod.
  inherited
destroyExistingPod(Object existing, Class type, String name) → Future<void>
  Destroys an existing pod instance by invoking its destruction methods.
  override
destroyPod(String name, Object pod) → Future<void>
  Destroy the given pod.
  inherited
destroyScopedPod(String name) → void
  Destroys all pods in the specified scope.
  inherited
destroySingleton(String name) → void
  Destroy the given pod. Delegates to destroyPod if a corresponding disposable pod instance is found.
  inherited
destroySingletons() → void
  Destroy all singleton pods in this registry.
  inherited
determineCandidateArguments(String podName, Executable executable, List<Parameter> parameters) → Future<List<ArgumentValue>?>
  Determines the candidate arguments for a pod instance.
determineConstructorsFromPodProcessors(Class podClass, String podName) → Future<List<Constructor>?>
doCreate(String name, RootPodDefinition definition, List<ArgumentValue>? args) → FutureOr<Object>
  Abstract method for creating pod instances that must be implemented by subclasses.
  override
doGet(String name, Class<Object>? type, List<ArgumentValue>? args, [bool prototypeInSingleton = false]) → Future<Object>
  Main template method for pod retrieval that implements the core resolution algorithm.
  inherited
doGetObject(Object instance, Class? type, String name, String transformed, PodDefinition? definition) → Future<Object>
  Internal method to handle PodProvider unwrapping and instance retrieval.
  override
doGetSingleton(String name, {bool allowEarlyReference = true, ObjectFactory<Object>? factory}) → Future<TypedInstance?>
  Get the singleton instance for the given name.
  inherited
doResolveDependency(DependencyDescriptor descriptor, [Set<String>? autowiredPods]) → Future<Object?>
  Abstract method that must be implemented by subclasses to resolve dependencies according to the specific factory implementation.
evaluateExpression(Object? value, PodDefinition? podDefinition) → FutureOr<ObjectHolder<Object>?>
  Evaluates a pod expression using the configured expression resolver.
  inherited
get<T>(Class<T> type, [List<ArgumentValue>? args]) → Future<T>
  Retrieves a pod instance by its type with optional arguments.
  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
getAllowCircularReferences() → bool
  Retrieves the current circular reference setting.
  override
getAllowDefinitionOverriding() → bool
  Retrieves the current definition overriding setting.
  override
getAllowRawInjectionEvenWhenWrapped() → bool
  Retrieves the current raw injection despite wrapping setting.
  override
getApplicationStartup() → ApplicationStartup
  Defines a contract for components that are aware of and can interact with an ApplicationStartup strategy.
  inherited
getConversionService() → ConversionService
  Retrieves the currently assigned ConversionService.
  inherited
getDefinition(String name) → PodDefinition
  Return the registered PodDefinition for the specified pod, allowing access to its property values and constructor argument value (which can be modified during pod factory post-processing).
  inherited
getDefinitionByClass(Class type) → PodDefinition
  Returns the pod definition for the specified class type.
  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
getEarlyPodReference(String podName, RootPodDefinition rpd, ObjectHolder<Object> pod) → Future<ObjectHolder<Object>>
getExecutableStrategy() → ExecutableStrategy
  Executable Strategy
getLocalMergedPodDefinition(String name) → RootPodDefinition
  Returns the locally cached merged pod definition if available and not stale.
  inherited
getMergedPodDefinition(String name) → RootPodDefinition
  Retrieves the merged pod definition for the specified pod name.
  inherited
getNamedObject(String name, [List<ArgumentValue>? args]) → Future<Object>
  Retrieves a pod as a generic Object by its name with optional arguments.
  inherited
getNullableProviderObject(String name) → ObjectHolder<Object>?
  Returns the cached raw object for a provider-managed pod, if present.
  inherited
getObject(Class<Object> type, [List<ArgumentValue>? args]) → Future<Object>
  Retrieves a pod as a generic Object by its type with optional arguments.
  inherited
getPackageName() → String
  Represents an abstraction for identifying the package that an object, resource, or service belongs to.
  inherited
getParentFactory() → PodFactory?
  Retrieves the parent factory in the hierarchy, if any.
  inherited
getPod<T>(String name, [List<ArgumentValue>? args, Class<T>? type]) → Future<T>
  Retrieves a pod instance by its name with optional arguments.
  inherited
getPodProcessorCount() → int
  Gets the number of registered pod-aware processors.
  inherited
getPodProcessors() → List<PodProcessor>
  Retrieves all registered pod-aware processors.
  inherited
getPodClass(String podName) → Future<Class>
  Retrieves the Class object for the specified pod name.
  inherited
getPodExpressionResolver() → PodExpressionResolver?
  Retrieves the current expression resolver.
  inherited
getPodProcessorCacheManager() → PodProcessorCacheManager
  Returns the pod processor cache manager, creating it if necessary.
  inherited
getPodProvider(String podName, Object instance) → PodProvider
  Retrieves the PodProvider backing a pod.
  inherited
getPodProviderType(PodProvider provider, bool allowPodProviderInit) → Future<Class?>
  inherited
getProvider<T>(Class<T> type, {String? podName, bool allowEagerInit = false}) → Future<ObjectProvider<T>>
  Retrieves a provider for a pod, allowing for lazy or eager initialization.
  inherited
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.
  inherited
getRegisteredScope(String scopeName) → PodScope?
  Retrieves a registered scope by name.
  inherited
getRegisteredScopeNames() → List<String>
  Retrieves all registered scope names.
  inherited
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
getUnsatisfiedNonSimpleProperties(PodDefinition root, PodHolder ph) → Map<String, Class>
  Gets a map of property names to their types that are not satisfied by existing property values and are not simple types.
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
hasDestructionPodPostProcessors() → bool
  Returns true if there are any destruction pod post-processors registered.
  inherited
hasInstantiationPodPostProcessors() → bool
  Returns true if there are any instantiation pod post-processors registered.
  inherited
hasPodPostProcessors() → bool
  Returns true if there are any pod post-processors registered.
  inherited
hasStartedCreatingPod() → bool
  Checks if a pod has already been created.
  inherited
ignoreDependencyInterface(Class type) → void
  Ignores the specified dependency interface and all its implementations during autowiring.
ignoreDependencyType(Class type) → void
  Ignores the specified dependency type during autowiring.
initializeExistingPod(Object existing, Class podClass, String podName) → Future<Object>
  Initializes an existing pod instance by applying post-processors and calling initialization methods.
initializePod(Object existing, Class type, String name) → Future<void>
  Initializes a pod instance by invoking its lifecycle methods.
  override
instantiateFromSupplier(Object supplier) → Future<Object>
instantiateUsingConstructor(String podName, RootPodDefinition root, List<Constructor>? chosenConstructors, List<ArgumentValue>? explicitArgs) → Future<Object>
  Instantiates a pod using constructor injection.
instantiateUsingFactoryMethod(String podName, RootPodDefinition root, List<ArgumentValue>? args) → Future<Object>
  Instantiates a pod using a factory method defined in the pod definition.
isActuallyInCreation(String name) → bool
  Check whether the specified singleton pod is actually in creation.
  inherited
isAlias(String name) → bool
  Checks whether the given `name` is registered as an alias.
  inherited
isCachePodMetadata() → bool
  Checks if pod metadata caching is enabled.
  inherited
isCurrentlyCreatingPrototype(String name) → bool
  Checks if a prototype pod is currently being created.
  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
isInterfaceIgnored(Class type) → bool
  Checks if the specified interface is ignored during dependency resolution.
isNameInUse(String name) → Future<bool>
  Checks if a pod name is already in use in this factory.
  inherited
isPodEligibleForMetadataCaching(String name) → bool
  Checks if a pod is eligible for metadata caching.
  inherited
isPodProvider(String name, [RootPodDefinition? rpd]) → Future<bool>
  Checks if the specified pod name refers to a pod provider.
  inherited
isPrototype(String name) → Future<bool>
  Checks if the specified pod is configured as a prototype.
  inherited
isSingleton(String name) → Future<bool>
  Checks if the specified pod is configured as a singleton.
  inherited
isTypeIgnored(Class type) → bool
  Checks if the specified type is ignored during dependency resolution.
isTypeMatch(String name, Class typeToMatch, [bool allowPodProviderInit = false]) → Future<bool>
  Checks if the pod with the specified name matches the given type.
  inherited
markPodAsCreated(String name) → void
  Marks a pod as having been created at least once.
  inherited
noSuchMethod(Invocation invocation) → dynamic
  Invoked when a nonexistent method or property is accessed.
  inherited
onSuppressedException(Exception ex) → void
  Handle a suppressed exception.
  inherited
originalPodName(String name) → String
  Returns the original pod name by removing any prefix and suffix.
  inherited
podProviderName(String name) → String
  Gets the name of a pod with the appended pod provider prefix.
  inherited
populate(String podName, RootPodDefinition root, PodHolder ph) → Future<void>
  Populates a pod instance with property values and dependencies.
postProcessObjectFromPodProvider(ObjectHolder<Object> object, String name) → Future<ObjectHolder<Object>>
  Retrieves the PodProvider backing a pod.
  override
registerAlias(String name, String alias) → void
  Registers an alias for an existing name in the registry.
  inherited
registerContainedPod(String containedPodName, String containingPodName) → void
  Register a containment relationship between two pods.
  inherited
registerDependentPod(String name, String dependentName) → void
  Register a dependent pod for the given pod.
  inherited
registerDisposableHandler(String name, DisposablePod pod, RootPodDefinition root) → Future<void>
  Registers a disposable handler for a pod that requires destruction callbacks.
  inherited
registerDisposablePod(String name, DisposablePod pod, [String? qualifiedName]) → void
  Register a disposable pod for the given pod name.
  inherited
registerScope(String scopeName, PodScope scope) → void
  Registers a new scope with the given name.
  inherited
registerSingleton(String name, Class type, {ObjectHolder<Object>? object, ObjectFactory<Object>? factory}) → Future<void>
  Register a new `pod` under the given `name`.
  inherited
removeAlias(String alias) → void
  Removes an alias from the registry.
  inherited
removeSingleton(String name) → void
  Remove the pod associated with `name`.
  override
removeSingletonIfCreated(String name) → bool
  Removes a singleton pod if it has been created.
  inherited
requiresDestruction(Object pod, RootPodDefinition root) → Future<bool>
  Checks if a pod requires destruction.
  inherited
resetPodProcessorCache() → void
  Resets the pod processor cache, clearing all cached post-processors.
  inherited
resolveAliases(String valueResolver(String)) → void
  Resolve all alias target names and aliases registered in this registry, applying the given StringValueResolver to them.
  inherited
resolveBeforeInstantiation(String podName, PodDefinition root) → Future<Object?>
  Gives PodInstantiationProcessors a chance to return a proxy instead of the target pod instance before instantiation.
resolveDependency(DependencyDescriptor descriptor, [Set<String>? autowiredPods]) → Future<Object?>
  Resolves a dependency based on the provided descriptor.
  override
setAllowCircularReferences(bool value) → void
  Allows or disallows circular references between pods.
  override
setAllowDefinitionOverriding(bool value) → void
  Allows or disallows overriding of pod definitions.
  override
setAllowRawInjectionEvenWhenWrapped(bool value) → void
  Allows or disallows raw injection despite wrapping.
  override
setApplicationStartup(ApplicationStartup applicationStartup) → void
  Defines a contract for components that are aware of and can interact with an ApplicationStartup strategy.
  inherited
setCachePodMetadata(bool cacheMetadata) → void
  Enables or disables caching of pod metadata for performance optimization.
  inherited
setConversionService(ConversionService conversionService) → void
  Sets an assigned ConversionService.
  inherited
setCurrentlyInCreation(String name, bool inCreation) → void
  Set the specified singleton pod as currently in creation.
  inherited
setExecutableStrategy(ExecutableStrategy executableStrategy) → void
  Sets the executable strategy used by this factory.
setParentFactory(PodFactory? parent) → void
  Sets the parent factory for this hierarchical factory.
  inherited
setPodExpressionResolver(PodExpressionResolver? valueResolver) → void
  Sets the expression resolver for resolving expressions in pod definitions.
  inherited
setPropertyValue(PodHolder ph, PropertyValue pv) → void
  Sets a property value on the pod instance using reflection.
targetName(String name) → String
  Determine the target name, resolving aliases to their ultimate target.
  inherited
toString() → String
  A string representation of this object.
  inherited
transformedPodName(String name) → String
  Transforms a pod name by removing any prefix and suffix.
  inherited

## Operators

operator ==(Object other) → bool
  The equality operator.
  inherited