1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package com.germinus.easyconf;
17
18 import org.apache.commons.lang.exception.NestableRuntimeException;
19
20
21 /***
22 * Some unrecoverable but important error has ocurred while reading the configuration
23 *
24 * @author Jorge Ferrer
25 * @version $Revision: 1.3 $
26 *
27 */
28 public class ConfigurationException extends NestableRuntimeException {
29
30 private String componentName;
31
32 public ConfigurationException() {
33 super();
34 }
35
36 public ConfigurationException(String componentName, String msg, Throwable thr) {
37 super(msg, thr);
38 this.componentName = componentName;
39 }
40
41 protected ConfigurationException(String componentName) {
42 super();
43 this.componentName = componentName;
44 }
45
46 protected ConfigurationException(String componentName, Throwable e) {
47 super(e);
48 this.componentName = componentName;
49 }
50
51 public ConfigurationException(String componentName, String msg) {
52 super(msg);
53 this.componentName = componentName;
54 }
55
56 public String getComponentName() {
57 return componentName;
58 }
59
60
61 public String getMessage() {
62 return "Error reading configuration for " + componentName + ": " +
63 super.getMessage();
64 }
65
66
67 }