Class UnavailableFactoryException

All Implemented Interfaces:
Serializable

public class UnavailableFactoryException extends MissingFactoryResourceException
Thrown when a whole factory cannot be created because a resource is missing. The most common case is when the EPSGFactory has no connection to an EPSG database.

Relationship with other exceptions

This exception means that the whole factory is unusable. By contrast, Missing­Factory­Resource­Exception means that at least one particular object cannot be created, but other objects may be okay.
Since:
0.7
See Also:
  • Constructor Details

    • UnavailableFactoryException

      public UnavailableFactoryException()
      Construct an exception with no detail message.
    • UnavailableFactoryException

      public UnavailableFactoryException(String message)
      Construct an exception with the specified detail message.
      Parameters:
      message - the detail message. The detail message is saved for later retrieval by the Throwable​.get­Message() method.
    • UnavailableFactoryException

      public UnavailableFactoryException(String message, Throwable cause)
      Construct an exception with the specified detail message and cause. The cause is the exception thrown in the underlying database (e.g. IOException or SQLException).
      Parameters:
      message - the detail message. The detail message is saved for later retrieval by the Throwable​.get­Message() method.
      cause - the cause for this exception. The cause is saved for later retrieval by the Throwable​.get­Cause() method.
  • Method Details

    • setUnavailableFactory

      public void setUnavailableFactory(AuthorityFactory factory)
      Specifies which factory is unavailable. This information can be provided when the exception occurred at some later stage after the factory construction (never inside the factory constructor), for example the first time that the factory tried to create an object.

      Example

      EPSGFactory may have been successfully created with a valid Data­Source. But the call to Data­Source​.get­Connection() happens only later (the first time that user invokes a method requiring a search in the database). In case of failure to connect to the database, user may discover late that the factory is actually unavailable. User may want to be informed about which factory is unavailable, for example in order to remove it from the list of factory managed by Multi­Authorities­Factory.
      Parameters:
      factory - the factory which is unavailable.
    • getUnavailableFactory

      public AuthorityFactory getUnavailableFactory()
      Returns the factory which has been found unavailable, or null if unspecified. See set­Unavailable­Factory(Authority­Factory) for more details.
      Returns:
      the factory that should be considered as unavailable.