FileDocCategorySizeDatePackage
InternalException.javaAPI DocApache Axis 1.42960Sat Apr 22 18:57:28 BST 2006org.apache.axis

InternalException

public class InternalException extends 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)
author
Glyn Normington (glyn_normington@uk.ibm.com)

Fields Summary
protected static Log
log
The Log used by this class to log messages.
private static boolean
shouldLog
Attribute which controls whether or not logging of such events should occur. Default is true and is recommended. Sometimes this may be turned off in unit tests when internal errors are intentionally provoked.
Constructors Summary
public InternalException(String message)
Construct an Internal Exception from a String. The string is wrapped in an exception, enabling a stack traceback to be obtained.

param
message String form of the error

        this(new Exception(message));
    
public InternalException(Exception e)
Construct an Internal Exception from an Exception.

param
e original exception which was unexpected

        super(e.toString());

        if (shouldLog) {
            // if the exception is merely bubbling up the stack, only log the
            // event if debug is turned on.
            if (e instanceof InternalException) {
                log.debug("InternalException: ", e);
            } else {
                log.fatal(Messages.getMessage("exception00"), e);
            }
        }
    
Methods Summary
public static booleangetLogging()
Discover whether the logging flag is set.

return
true if we are logging, false otherwise

        return shouldLog;
    
public static voidsetLogging(boolean logging)
Enable or dissable logging.

param
logging true if you wish logging to be enabled, false otherwise


                          
         
        shouldLog = logging;