1 16 17 package org.apache.axis; 18 19 import org.apache.axis.components.logger.LogFactory; 20 import org.apache.axis.utils.Messages; 21 import org.apache.commons.logging.Log; 22 23 31 public class InternalException extends RuntimeException { 32 33 36 protected static Log log = 37 LogFactory.getLog(InternalException.class.getName()); 38 39 45 private static boolean shouldLog = true; 46 47 52 public static void setLogging(boolean logging) { 53 shouldLog = logging; 54 } 55 56 61 public static boolean getLogging() { 62 return shouldLog; 63 } 64 65 70 public InternalException(String message) { 71 this(new Exception (message)); 72 } 73 74 79 public InternalException(Exception e) { 80 super(e.toString()); 81 82 if (shouldLog) { 83 if (e instanceof InternalException) { 86 log.debug("InternalException: ", e); 87 } else { 88 log.fatal(Messages.getMessage("exception00"), e); 89 } 90 } 91 } 92 } 93 | Popular Tags |