Class WaiterFailedException

All Implemented Interfaces:
Serializable

public class WaiterFailedException extends WaiterException
Thrown by ResourceWaiter.await() when the resource reaches a terminal failure state (the configured failWhen condition) before succeeding. Carries the failed resource.
Author:
ianjones
See Also:
  • Constructor Details

    • WaiterFailedException

      public WaiterFailedException(String message, Object resource)
  • Method Details

    • getResource

      public Object getResource()
      Returns:
      the resource in its failure state, or null (always null after serialization, as the payload is transient)
    • getResource

      public <T> T getResource(Class<T> type)
      Typed convenience accessor for the failed resource, e.g. ex.getResource(Connection.class).
      Type Parameters:
      T - the expected resource type
      Parameters:
      type - the expected resource type
      Returns:
      the resource cast to type, or null if absent
      Throws:
      ClassCastException - if the resource is not of the given type