1   /*
2    * Copyright 2001-2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */ 
16  
17  package org.apache.commons.logging;
18  
19  
20  /**
21   * <p>An exception that is thrown only if a suitable <code>LogFactory</code>
22   * or <code>Log</code> instance cannot be created by the corresponding
23   * factory methods.</p>
24   * 
25   * <p>In this version of JCL, this exception will never be thrown in practice. However, it is 
26   * included here to ensure total compile time and run time compatibility with the original JCL 1.0.4.
27   * 
28   * @author Craig R. McClanahan
29   */
30  
31  public class LogConfigurationException extends RuntimeException {
32  
33  
34      /**
35       * Construct a new exception with <code>null</code> as its detail message.
36       */
37      public LogConfigurationException() {
38  
39          super();
40  
41      }
42  
43  
44      /**
45       * Construct a new exception with the specified detail message.
46       *
47       * @param message The detail message
48       */
49      public LogConfigurationException(String message) {
50  
51          super(message);
52  
53      }
54  
55  
56      /**
57       * Construct a new exception with the specified cause and a derived
58       * detail message.
59       *
60       * @param cause The underlying cause
61       */
62      public LogConfigurationException(Throwable cause) {
63  
64          this((cause == null) ? null : cause.toString(), cause);
65  
66      }
67  
68  
69      /**
70       * Construct a new exception with the specified detail message and cause.
71       *
72       * @param message The detail message
73       * @param cause The underlying cause
74       */
75      public LogConfigurationException(String message, Throwable cause) {
76  
77          super(message + " (Caused by " + cause + ")");
78          this.cause = cause; // Two-argument version requires JDK 1.4 or later
79  
80      }
81  
82  
83      /**
84       * The underlying cause of this exception.
85       */
86      protected Throwable cause = null;
87  
88  
89      /**
90       * Return the underlying cause of this exception (if any).
91       */
92      public Throwable getCause() {
93  
94          return (this.cause);
95  
96      }
97  
98  
99  }