Class KnowledgeNotReadyException

All Implemented Interfaces:
Serializable

public class KnowledgeNotReadyException extends ValidationException
Thrown when a configured WHEN_CONFIGURED source is not ready before a run: its file is missing, it holds no unit, or it cannot be read.

The message names the host class and the source, not the file path or the target. An exception created for a target carries it in target(), so a host can name the target in its own refusal.

Since:
0.18.1
See Also:
  • Constructor Details

    • KnowledgeNotReadyException

      public KnowledgeNotReadyException(Class<?> host, String source, KnowledgeNotReadyException.Problem problem)
      Creates the exception.
      Parameters:
      host - the class whose knowledge declares the source
      source - the source name
      problem - why the source is not ready
    • KnowledgeNotReadyException

      public KnowledgeNotReadyException(Class<?> host, String source, KnowledgeNotReadyException.Problem problem, Throwable cause)
      Creates the exception with a cause.
      Parameters:
      host - the class whose knowledge declares the source
      source - the source name
      problem - why the source is not ready
      cause - the underlying failure, or null
    • KnowledgeNotReadyException

      public KnowledgeNotReadyException(Object target, String source, KnowledgeNotReadyException.Problem problem)
      Creates the exception for a checked target, whose class is the host.
      Parameters:
      target - the instance whose knowledge was checked
      source - the source name
      problem - why the source is not ready
    • KnowledgeNotReadyException

      public KnowledgeNotReadyException(Object target, String source, KnowledgeNotReadyException.Problem problem, Throwable cause)
      Creates the exception for a checked target with a cause.
      Parameters:
      target - the instance whose knowledge was checked
      source - the source name
      problem - why the source is not ready
      cause - the underlying failure, or null
  • Method Details

    • host

      public Class<?> host()
      Returns the class whose knowledge declares the source.
      Returns:
      the host class
    • source

      public String source()
      Returns the source name.
      Returns:
      the source name
    • problem

      Returns why the source is not ready.
      Returns:
      the problem
    • target

      public Object target()
      Returns the instance whose knowledge was checked. The field is transient: it is null after deserialization, and for an exception created from a host class.
      Returns:
      the checked target, or null