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>PortletModeException</CODE> is thrown when a portlet
25 * tries to use or set a portlet mode that is not supported by the current
26 * runtime environment or the portlet.
27 */
28
29 public class PortletModeException extends PortletException
30 {
31
32
33 private transient PortletMode _mode = null;
34
35 /***
36 * Constructs a new portlet mode exception with the given text and the
37 * portlet mode that caused this exception. The
38 * portlet container may use the text and portlet mode write it to a log.
39 *
40 * @param text
41 * the exception text
42 * @param mode
43 * the mode causing the exception
44 */
45
46 public PortletModeException (String text, PortletMode mode)
47 {
48 super (text);
49 _mode = mode;
50 }
51
52 /***
53 * Constructs a new portlet mode exception when the portlet needs to do
54 * the following:
55 * <ul>
56 * <il>throw an exception
57 * <li>include a message about the "root cause" that interfered
58 * with its normal operation
59 * <li>include a description message
60 * <li>include the portlet mode that caused this exception
61 * </ul>
62 *
63 * @param text
64 * the exception text
65 * @param cause
66 * the root cause
67 * @param mode
68 * the mode causing the exception
69 */
70
71 public PortletModeException (String text, Throwable cause, PortletMode mode)
72 {
73 super(text, cause);
74 _mode = mode;
75 }
76
77 /***
78 * Constructs a new portlet mode exception when the portlet needs to throw an
79 * exception. The exception message is based on the localized message
80 * of the underlying exception and the portlet mode that caused this exception.
81 *
82 * @param cause
83 * the root cause
84 * @param mode
85 * the mode causing the exception
86 */
87
88 public PortletModeException (Throwable cause, PortletMode mode)
89 {
90 super(cause);
91 _mode = mode;
92 }
93
94 /***
95 * Returns the unsupported portlet mode causing this exception.
96 *
97 * @return the portlet mode that caused this exception
98 */
99
100 public PortletMode getMode()
101 {
102 return _mode;
103 }
104 }