KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > pluto > PortletContainerException


1 /*
2  * Copyright 2003,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
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 JavaDoc
30 {
31
32     private Throwable JavaDoc 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 JavaDoc 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 JavaDoc text, Throwable JavaDoc cause)
67     {
68         super (text); //, cause);
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 JavaDoc 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 JavaDoc getRootCause ()
96     {
97         return (cause);
98     }
99 }
100
Popular Tags