# resolveBeforeInstantiation method

1. @protected

Future<Object?> resolveBeforeInstantiation(

1. String podName,
2. PodDefinition root

)

Gives PodInstantiationProcessors a chance to return a proxy instead of the target pod instance before instantiation.

@param podName The name of the pod being created @param root The pod definition @return A proxy object if any processor returns one, null otherwise

## Implementation

    @protected
    Future<Object?> resolveBeforeInstantiation(String podName, PodDefinition root) async {
      Object? pod;

      if (root.hasBeforeInstantiationResolved) {
        return pod;
      }

      if (!root.design.isInfrastructure && hasInstantiationPodPostProcessors()) {
        pod = await applyBeforeInstantiationProcessing(podName, root);
        if (pod != null) {
          pod = await applyAfterInitializationProcessing(pod, podName, root.type);
        }
      }

      root.hasBeforeInstantiationResolved = pod != null;

      return pod;
    }