1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.pluto;
21
22 /***
23 ** The <CODE>PortletContainerException</CODE> class defines a general exception
24 ** that the portlet container can throw when it encounters difficulty.
25 **
26
27 **/
28
29 public class PortletContainerException extends Exception
30 {
31
32 private Throwable cause;
33
34 /***
35 ** Constructs a new portlet exception.
36 **/
37
38 public PortletContainerException ()
39 {
40 }
41
42 /***
43 ** Constructs a new portlet invoker exception with the given text. The
44 ** layout system may use the text write it to a log.
45 **
46 ** @param text
47 ** the exception text
48 **/
49
50 public PortletContainerException (String text)
51 {
52 super (text);
53 }
54
55 /***
56 ** Constructs a new portlet invoker exception when the invoker needs to throw an
57 ** exception and include a message about the "root case" that interfered
58 ** with its normal operation, including a description message.
59 **
60 ** @param text
61 ** the exception text
62 ** @param cause
63 ** the root cause
64 **/
65
66 public PortletContainerException (String text, Throwable cause)
67 {
68 super (text);
69
70 this.cause = cause;
71 }
72
73 /***
74 ** Constructs a new portlet invoker exception when the portlet needs to throw an
75 ** exception. The exception's message is based on the localized message
76 ** of the underlying exception.
77 **
78 ** @param cause
79 ** the root cause
80 **/
81
82 public PortletContainerException (Throwable cause)
83 {
84 super (cause.getLocalizedMessage ());
85
86 this.cause = cause;
87 }
88
89 /***
90 ** Returns the exception that cause this portlet exception.
91 **
92 ** @return the <CODE>Throwable</CODE> that caused this portlet exception.
93 **/
94
95 public Throwable getRootCause ()
96 {
97 return (cause);
98 }
99 }