KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > guiframework > exception > FrameworkException


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.enterprise.tools.guiframework.exception;
25
26 import com.iplanet.jato.view.View;
27
28 import com.sun.enterprise.tools.guiframework.view.descriptors.ViewDescriptor;
29
30
31 public class FrameworkException extends RuntimeException JavaDoc implements ViewDescriptorHolder {
32
33     /**
34      * This is the preferred constructor.
35      */

36     public FrameworkException(String JavaDoc msg, Throwable JavaDoc ex, ViewDescriptor viewDesc, View view) {
37     super(msg, ex);
38
39     // Setup the rest
40
setResponsibleViewDescriptor(viewDesc);
41     setResponsibleView(view);
42     }
43
44
45     /**
46      *
47      */

48     public FrameworkException() {
49     super();
50     }
51
52
53     /**
54      *
55      */

56     public FrameworkException(ViewDescriptor viewDesc, View view) {
57     super();
58
59     // Setup the rest
60
setResponsibleViewDescriptor(viewDesc);
61     setResponsibleView(view);
62     }
63
64
65     /**
66      *
67      */

68     public FrameworkException(Throwable JavaDoc ex) {
69     super(ex);
70     }
71
72
73     /**
74      *
75      */

76     public FrameworkException(Throwable JavaDoc ex, ViewDescriptor viewDesc, View view) {
77     super(ex);
78
79     // Setup the rest
80
setResponsibleViewDescriptor(viewDesc);
81     setResponsibleView(view);
82     }
83
84
85     /**
86      *
87      */

88     public FrameworkException(String JavaDoc msg) {
89     super(msg);
90     }
91
92
93     /**
94      * This is the preferred constructor if there is no root cause.
95      */

96     public FrameworkException(String JavaDoc msg, ViewDescriptor viewDesc, View view) {
97     super(msg);
98
99     // Setup the rest
100
setResponsibleViewDescriptor(viewDesc);
101     setResponsibleView(view);
102     }
103
104
105     /**
106      *
107      */

108     public FrameworkException(String JavaDoc msg, Throwable JavaDoc ex) {
109     super(msg, ex);
110     }
111
112
113     /**
114      * Allow the Exception to hold the responsible View
115      */

116     public void setResponsibleView(View view) {
117     _view = view;
118     }
119
120
121     /**
122      * Allow the Exception to hold the responsible View
123      */

124     public View getResponsibleView() {
125     return _view;
126     }
127
128
129     /**
130      * Allow the Exception to hold the responsible ViewDescriptor
131      */

132     public void setResponsibleViewDescriptor(ViewDescriptor viewDesc) {
133     _viewDesc = viewDesc;
134     }
135
136
137     /**
138      * Allow the responsible ViewDescriptor to be obtained.
139      *
140      * @return The responsible ViewDescriptor (null if not specified)
141      */

142     public ViewDescriptor getResponsibleViewDescriptor() {
143     return _viewDesc;
144     }
145
146
147     private View _view = null;
148     private ViewDescriptor _viewDesc = null;
149 }
150
Popular Tags