getPodProvider method
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.
Implementation
@protected
PodProvider getPodProvider(String podName, Object instance) {
if (instance is! PodProvider) {
throw PodCreationException("Pod $podName is not an instance of PodProvider");
}
return instance;
}