getPodProvider method

  1. @protected
PodProvider getPodProvider(
  1. String podName,
  2. Object instance
)

Retrieves the PodProvider backing a pod.

This hook is responsible for validating and casting the pod instance into a usable PodProvider.

Default Behavior

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;
}