1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package javax.portlet;
22
23 /***
24 ** The <CODE>WindowStateException</CODE> is thrown when a portlet
25 ** tries to use a window state that is not supported by the current
26 ** runtime environment or the portlet.
27 **/
28
29 public class WindowStateException extends PortletException
30 {
31
32
33 private transient WindowState _state = null;
34
35 /***
36 * Constructs a new portlet state exception with the given text. The
37 * portlet container may use the text write it to a log.
38 *
39 * @param text
40 * the exception text
41 * @param state
42 * the state causing the exception
43 */
44
45 public WindowStateException (String text, WindowState state)
46 {
47 super (text);
48 _state = state;
49 }
50
51 /***
52 * Constructs a new portlet state exception when the portlet needs to do
53 * the following:
54 * <ul>
55 * <il>throw an exception
56 * <li>include a message about the "root cause" that interfered
57 * with its normal operation
58 * <li>include a description message
59 * </ul>
60 *
61 * @param text
62 * the exception text
63 * @param cause
64 * the root cause
65 * @param state
66 * the state causing the exception
67 */
68
69 public WindowStateException (String text, Throwable cause, WindowState state)
70 {
71 super(text, cause);
72 _state = state;
73 }
74
75 /***
76 * Constructs a new portlet state exception when the portlet needs to throw an
77 * exception. The exception message is based on the localized message
78 * of the underlying exception.
79 *
80 * @param cause
81 * the root cause
82 * @param state
83 * the state causing the exception
84 */
85
86 public WindowStateException (Throwable cause, WindowState state)
87 {
88 super(cause);
89 _state = state;
90 }
91
92 /***
93 * Returns the portlet state causing this exception.
94 *
95 * @return the window state causing this exception
96 */
97
98 public WindowState getState()
99 {
100 return _state;
101 }
102 }