KickJava   Java API By Example, From Geeks To Geeks.

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


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 /**
32  * This error is used to propagate errors that should be seen be the user.
33  */

34 public class FrameworkError extends Error JavaDoc implements ViewDescriptorHolder {
35
36     /**
37      *
38      */

39     public FrameworkError() {
40     super();
41     }
42
43
44     /**
45      *
46      */

47     public FrameworkError(ViewDescriptor viewDesc, View view) {
48     super();
49
50     // Setup the rest
51
setResponsibleViewDescriptor(viewDesc);
52     setResponsibleView(view);
53     }
54
55
56     /**
57      *
58      */

59     public FrameworkError(Throwable JavaDoc ex) {
60     super(ex);
61     }
62
63
64     /**
65      *
66      */

67     public FrameworkError(Throwable JavaDoc ex, ViewDescriptor viewDesc, View view) {
68     super(ex);
69
70     // Setup the rest
71
setResponsibleViewDescriptor(viewDesc);
72     setResponsibleView(view);
73     }
74
75
76     /**
77      *
78      */

79     public FrameworkError(String JavaDoc msg) {
80     super(msg);
81     }
82
83
84     /**
85      * This is the preferred constructor if there is no root cause.
86      */

87     public FrameworkError(String JavaDoc msg, ViewDescriptor viewDesc, View view) {
88     super(msg);
89
90     // Setup the rest
91
setResponsibleViewDescriptor(viewDesc);
92     setResponsibleView(view);
93     }
94
95
96     /**
97      *
98      */

99     public FrameworkError(String JavaDoc msg, Throwable JavaDoc ex) {
100     super(msg, ex);
101     }
102
103
104     /**
105      * This is the preferred constructor.
106      */

107     public FrameworkError(String JavaDoc msg, Throwable JavaDoc ex, ViewDescriptor viewDesc, View view) {
108     super(msg, ex);
109
110     // Setup the rest
111
setResponsibleViewDescriptor(viewDesc);
112     setResponsibleView(view);
113     }
114
115
116     /**
117      * Allow the Error to hold the responsible View
118      */

119     public void setResponsibleView(View view) {
120     _view = view;
121     }
122
123
124     /**
125      * Allow the Error to hold the responsible View
126      */

127     public View getResponsibleView() {
128     return _view;
129     }
130
131
132     /**
133      * Allow the Error to hold the responsible ViewDescriptor
134      */

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

145     public ViewDescriptor getResponsibleViewDescriptor() {
146     return _viewDesc;
147     }
148
149
150     private View _view = null;
151     private ViewDescriptor _viewDesc = null;
152 }
153
Popular Tags