KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > catalina > cluster > session > DeltaSessionFacade


1 /*
2  * Copyright 1999,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
17
18 package org.apache.catalina.cluster.session;
19
20
21 import java.util.Enumeration JavaDoc;
22
23 import javax.servlet.ServletContext JavaDoc;
24 import javax.servlet.http.HttpSession JavaDoc;
25 import javax.servlet.http.HttpSessionContext JavaDoc;
26
27
28 /**
29  * Facade for the DeltaSession object.
30  *
31  * @author Remy Maucherat
32  * @author Filip Hanik
33  * @version $Revision: 1.2 $ $Date: 2004/02/27 14:58:56 $
34  */

35
36 public class DeltaSessionFacade
37     implements HttpSession JavaDoc {
38
39
40     // ----------------------------------------------------------- Constructors
41

42
43     /**
44      * Construct a new session facade.
45      */

46     public DeltaSessionFacade(DeltaSession session) {
47         super();
48         this.session = (HttpSession JavaDoc) session;
49     }
50
51
52     /**
53      * Construct a new session facade.
54      */

55     public DeltaSessionFacade(HttpSession JavaDoc session) {
56         super();
57         this.session = session;
58     }
59
60
61     // ----------------------------------------------------- Instance Variables
62

63
64     /**
65      * Wrapped session object.
66      */

67     private HttpSession JavaDoc session = null;
68
69
70     // ---------------------------------------------------- HttpSession Methods
71

72
73     public long getCreationTime() {
74         return session.getCreationTime();
75     }
76
77
78     public String JavaDoc getId() {
79         return session.getId();
80     }
81
82
83     public long getLastAccessedTime() {
84         return session.getLastAccessedTime();
85     }
86
87
88     public ServletContext JavaDoc getServletContext() {
89         // FIXME : Facade this object ?
90
return session.getServletContext();
91     }
92
93
94     public void setMaxInactiveInterval(int interval) {
95         session.setMaxInactiveInterval(interval);
96     }
97
98
99     public int getMaxInactiveInterval() {
100         return session.getMaxInactiveInterval();
101     }
102
103
104     public HttpSessionContext JavaDoc getSessionContext() {
105         return session.getSessionContext();
106     }
107
108
109     public Object JavaDoc getAttribute(String JavaDoc name) {
110         return session.getAttribute(name);
111     }
112
113
114     public Object JavaDoc getValue(String JavaDoc name) {
115         return session.getAttribute(name);
116     }
117
118
119     public Enumeration JavaDoc getAttributeNames() {
120         return session.getAttributeNames();
121     }
122
123
124     public String JavaDoc[] getValueNames() {
125         return session.getValueNames();
126     }
127
128
129     public void setAttribute(String JavaDoc name, Object JavaDoc value) {
130         session.setAttribute(name, value);
131     }
132
133
134     public void putValue(String JavaDoc name, Object JavaDoc value) {
135         session.setAttribute(name, value);
136     }
137
138
139     public void removeAttribute(String JavaDoc name) {
140         session.removeAttribute(name);
141     }
142
143
144     public void removeValue(String JavaDoc name) {
145         session.removeAttribute(name);
146     }
147
148
149     public void invalidate() {
150         session.invalidate();
151     }
152
153
154     public boolean isNew() {
155         return session.isNew();
156     }
157
158
159 }
160
Popular Tags