Class WaiterTimeoutException

All Implemented Interfaces:
Serializable

public class WaiterTimeoutException extends WaiterException
Thrown by ResourceWaiter.await() when the success condition is not met before the configured timeout elapses. Carries the last-observed resource for diagnostics.
Author:
ianjones
See Also:
  • Constructor Details

    • WaiterTimeoutException

      public WaiterTimeoutException(String message, Object lastObserved)
  • Method Details

    • getLastObserved

      public Object getLastObserved()
      Returns:
      the most recently fetched resource (the state observed at timeout), or null (always null after serialization, as the payload is transient)
    • getLastObserved

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