KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > portlet > WindowStateException


1 /**
2   * Copyright 2003 IBM Corporation and Sun Microsystems, Inc.
3   * All rights reserved.
4   * Use is subject to license terms.
5   */

6
7 package javax.portlet;
8
9 /**
10  ** The <CODE>WindowStateException</CODE> is thrown when a portlet
11  ** tries to use a window state that is not supported by the current
12  ** runtime environment or the portlet.
13  **/

14
15 public class WindowStateException extends PortletException
16 {
17
18   private transient WindowState _state = null;
19
20   /**
21    * Constructs a new portlet state exception with the given text. The
22    * portlet container may use the text write it to a log.
23    *
24    * @param text
25    * the exception text
26    * @param state
27    * the state causing the exception
28    */

29
30   public WindowStateException (String JavaDoc text, WindowState state)
31   {
32     super (text);
33     _state = state;
34   }
35
36   /**
37    * Constructs a new portlet state exception when the portlet needs to do
38    * the following:
39    * <ul>
40    * <il>throw an exception
41    * <li>include a message about the "root cause" that interfered
42    * with its normal operation
43    * <li>include a description message
44    * </ul>
45    *
46    * @param text
47    * the exception text
48    * @param cause
49    * the root cause
50    * @param state
51    * the state causing the exception
52    */

53   
54   public WindowStateException (String JavaDoc text, Throwable JavaDoc cause, WindowState state)
55   {
56     super(text, cause);
57     _state = state;
58   }
59
60   /**
61    * Constructs a new portlet state exception when the portlet needs to throw an
62    * exception. The exception message is based on the localized message
63    * of the underlying exception.
64    *
65    * @param cause
66    * the root cause
67    * @param state
68    * the state causing the exception
69    */

70
71   public WindowStateException (Throwable JavaDoc cause, WindowState state)
72   {
73     super(cause);
74     _state = state;
75   }
76
77   /**
78    * Returns the portlet state causing this exception.
79    *
80    * @return the window state causing this exception
81    */

82
83   public WindowState getState()
84   {
85     return _state;
86   }
87 }
88
Popular Tags