Class InternalException

  • All Implemented Interfaces:
    java.io.Serializable

    public class InternalException
    extends java.lang.RuntimeException
    Encapsulates exceptions for "should never occur" situations. Extends RuntimeException so it need not explicitly be caught. Logs the exception as a fatal error, and if debug is enabled, includes the full stack trace.
    Author:
    Sam Ruby (rubys@us.ibm.com), Glyn Normington (glyn_normington@uk.ibm.com)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static org.apache.commons.logging.Log log
      The Log used by this class to log messages.
    • Constructor Summary

      Constructors 
      Constructor Description
      InternalException​(java.lang.Exception e)
      Construct an Internal Exception from an Exception.
      InternalException​(java.lang.String message)
      Construct an Internal Exception from a String.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean getLogging()
      Discover whether the logging flag is set.
      static void setLogging​(boolean logging)
      Enable or dissable logging.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • log

        protected static org.apache.commons.logging.Log log
        The Log used by this class to log messages.
    • Constructor Detail

      • InternalException

        public InternalException​(java.lang.String message)
        Construct an Internal Exception from a String. The string is wrapped in an exception, enabling a stack traceback to be obtained.
        Parameters:
        message - String form of the error
      • InternalException

        public InternalException​(java.lang.Exception e)
        Construct an Internal Exception from an Exception.
        Parameters:
        e - original exception which was unexpected
    • Method Detail

      • setLogging

        public static void setLogging​(boolean logging)
        Enable or dissable logging.
        Parameters:
        logging - true if you wish logging to be enabled, false otherwise
      • getLogging

        public static boolean getLogging()
        Discover whether the logging flag is set.
        Returns:
        true if we are logging, false otherwise