KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > faces > context > FacesContext


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package javax.faces.context;
17
18 import javax.faces.application.FacesMessage;
19 import java.util.Iterator JavaDoc;
20
21 /**
22  * @author Manfred Geiler (latest modification by $Author: manolito $)
23  * @version $Revision: 1.5 $ $Date: 2004/09/30 08:43:10 $
24  */

25 public abstract class FacesContext
26 {
27     public abstract javax.faces.application.Application getApplication();
28
29     public abstract Iterator JavaDoc getClientIdsWithMessages();
30
31     public abstract javax.faces.context.ExternalContext getExternalContext();
32
33     public abstract FacesMessage.Severity getMaximumSeverity();
34
35     public abstract Iterator JavaDoc getMessages();
36
37     public abstract Iterator JavaDoc getMessages(String JavaDoc clientId);
38
39     public abstract javax.faces.render.RenderKit getRenderKit();
40
41     public abstract boolean getRenderResponse();
42
43     public abstract boolean getResponseComplete();
44
45     public abstract javax.faces.context.ResponseStream getResponseStream();
46
47     public abstract void setResponseStream(javax.faces.context.ResponseStream responseStream);
48
49     public abstract javax.faces.context.ResponseWriter getResponseWriter();
50
51     public abstract void setResponseWriter(javax.faces.context.ResponseWriter responseWriter);
52
53     public abstract javax.faces.component.UIViewRoot getViewRoot();
54
55     public abstract void setViewRoot(javax.faces.component.UIViewRoot root);
56
57     public abstract void addMessage(String JavaDoc clientId,
58                                     javax.faces.application.FacesMessage message);
59
60     public abstract void release();
61
62     public abstract void renderResponse();
63
64     public abstract void responseComplete();
65
66
67     private static ThreadLocal JavaDoc _currentInstance = new ThreadLocal JavaDoc()
68     {
69         protected Object JavaDoc initialValue()
70         {
71             return null;
72         }
73     };
74
75     public static FacesContext getCurrentInstance()
76     {
77         return (FacesContext)_currentInstance.get();
78     }
79
80     protected static void setCurrentInstance(javax.faces.context.FacesContext context)
81     {
82         _currentInstance.set(context);
83
84     }
85 }
86
Popular Tags