Source Code Cross Referenced for HttpSessionWrapper.java in  » J2EE » Sofia » com » salmonllc » html » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » Sofia » com.salmonllc.html 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        //** Copyright Statement ***************************************************
002:        //The Salmon Open Framework for Internet Applications (SOFIA)
003:        // Copyright (C) 1999 - 2002, Salmon LLC
004:        //
005:        // This program is free software; you can redistribute it and/or
006:        // modify it under the terms of the GNU General Public License version 2
007:        // as published by the Free Software Foundation;
008:        // 
009:        // This program is distributed in the hope that it will be useful,
010:        // but WITHOUT ANY WARRANTY; without even the implied warranty of
011:        // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012:        // GNU General Public License for more details.
013:        // 
014:        // You should have received a copy of the GNU General Public License
015:        // along with this program; if not, write to the Free Software
016:        // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
017:        // 
018:        // For more information please visit http://www.salmonllc.com
019:        //** End Copyright Statement ***************************************************
020:
021:        package com.salmonllc.html;
022:
023:        import java.util.Enumeration;
024:
025:        import javax.portlet.PortletContext;
026:        import javax.portlet.PortletSession;
027:        import javax.servlet.ServletContext;
028:        import javax.servlet.http.HttpSession;
029:        import javax.servlet.http.HttpSessionContext;
030:
031:        /**
032:         * Wrapper for the http session object, used by the framework to adapt portlet sessions to http sessions
033:         */
034:        public class HttpSessionWrapper implements  HttpSession {
035:            HttpSession _sess;
036:            PortletSession _psess;
037:
038:            public HttpSessionWrapper(PortletSession sess) {
039:                _psess = sess;
040:            }
041:
042:            public HttpSessionWrapper(HttpSession sess) {
043:                _sess = sess;
044:            }
045:
046:            /* (non-Javadoc)
047:             * @see javax.servlet.http.HttpSession#getAttribute(java.lang.String)
048:             */
049:            public Object getAttribute(String arg0) {
050:                if (_sess != null)
051:                    return _sess.getAttribute(arg0);
052:                else
053:                    return _psess.getAttribute(arg0,
054:                            PortletSession.APPLICATION_SCOPE);
055:            }
056:
057:            /* (non-Javadoc)
058:             * @see javax.servlet.http.HttpSession#getAttributeNames()
059:             */
060:            public Enumeration getAttributeNames() {
061:                if (_sess != null)
062:                    return _sess.getAttributeNames();
063:                else
064:                    return _psess
065:                            .getAttributeNames(PortletSession.APPLICATION_SCOPE);
066:            }
067:
068:            /* (non-Javadoc)
069:             * @see javax.servlet.http.HttpSession#getCreationTime()
070:             */
071:            public long getCreationTime() {
072:                if (_sess != null)
073:                    return _sess.getCreationTime();
074:                else
075:                    return _psess.getCreationTime();
076:            }
077:
078:            /* (non-Javadoc)
079:             * @see javax.servlet.http.HttpSession#getId()
080:             */
081:            public String getId() {
082:                if (_sess != null)
083:                    return _sess.getId();
084:                else
085:                    return _psess.getId();
086:            }
087:
088:            /* (non-Javadoc)
089:             * @see javax.servlet.http.HttpSession#getLastAccessedTime()
090:             */
091:            public long getLastAccessedTime() {
092:                if (_sess != null)
093:                    return _sess.getLastAccessedTime();
094:                else
095:                    return _psess.getLastAccessedTime();
096:            }
097:
098:            /* (non-Javadoc)
099:             * @see javax.servlet.http.HttpSession#getMaxInactiveInterval()
100:             */
101:            public int getMaxInactiveInterval() {
102:                if (_sess != null)
103:                    return _sess.getMaxInactiveInterval();
104:                else
105:                    return _psess.getMaxInactiveInterval();
106:            }
107:
108:            /* (non-Javadoc)
109:             * @see javax.servlet.http.HttpSession#getServletContext()
110:             */
111:            public ServletContext getServletContext() {
112:                //if (_sess != null)
113:                //	return _sess.getServletContext();
114:                //else
115:                return null;
116:            }
117:
118:            /* (non-Javadoc)
119:             * @see javax.servlet.http.HttpSession#getServletContext()
120:             */
121:            public PortletContext getPortletContext() {
122:                if (_sess != null)
123:                    return null;
124:                else
125:                    return _psess.getPortletContext();
126:            }
127:
128:            /* (non-Javadoc)
129:             * @see javax.servlet.http.HttpSession#getSessionContext()
130:             */
131:            public HttpSessionContext getSessionContext() {
132:                if (_sess != null)
133:                    return _sess.getSessionContext();
134:                else
135:                    return null;
136:            }
137:
138:            /* (non-Javadoc)
139:             * @see javax.servlet.http.HttpSession#getValue(java.lang.String)
140:             */
141:            public Object getValue(String arg0) {
142:                if (_sess != null)
143:                    return _sess.getAttribute(arg0);
144:                else
145:                    return _psess.getAttribute(arg0);
146:            }
147:
148:            /* (non-Javadoc)
149:             * @see javax.servlet.http.HttpSession#getValueNames()
150:             */
151:            public String[] getValueNames() {
152:                if (_sess != null)
153:                    return _sess.getValueNames();
154:                else
155:                    return null;
156:            }
157:
158:            /* (non-Javadoc)
159:             * @see javax.servlet.http.HttpSession#invalidate()
160:             */
161:            public void invalidate() {
162:                if (_sess != null)
163:                    _sess.invalidate();
164:                else
165:                    _psess.invalidate();
166:
167:            }
168:
169:            /* (non-Javadoc)
170:             * @see javax.servlet.http.HttpSession#isNew()
171:             */
172:            public boolean isNew() {
173:                if (_sess != null)
174:                    return _sess.isNew();
175:                else
176:                    return _psess.isNew();
177:            }
178:
179:            /* (non-Javadoc)
180:             * @see javax.servlet.http.HttpSession#putValue(java.lang.String, java.lang.Object)
181:             */
182:            public void putValue(String arg0, Object arg1) {
183:                if (_sess != null)
184:                    _sess.setAttribute(arg0, arg1);
185:                else
186:                    _psess.setAttribute(arg0, arg1,
187:                            PortletSession.APPLICATION_SCOPE);
188:            }
189:
190:            /* (non-Javadoc)
191:             * @see javax.servlet.http.HttpSession#removeAttribute(java.lang.String)
192:             */
193:            public void removeAttribute(String arg0) {
194:                if (_sess != null)
195:                    _sess.removeAttribute(arg0);
196:                else
197:                    _psess.removeAttribute(arg0,
198:                            PortletSession.APPLICATION_SCOPE);
199:            }
200:
201:            /* (non-Javadoc)
202:             * @see javax.servlet.http.HttpSession#removeValue(java.lang.String)
203:             */
204:            public void removeValue(String arg0) {
205:                if (_sess != null)
206:                    _sess.removeAttribute(arg0);
207:                else
208:                    _psess.removeAttribute(arg0,
209:                            PortletSession.APPLICATION_SCOPE);
210:
211:            }
212:
213:            /* (non-Javadoc)
214:             * @see javax.servlet.http.HttpSession#setAttribute(java.lang.String, java.lang.Object)
215:             */
216:            public void setAttribute(String arg0, Object arg1) {
217:                if (_sess != null)
218:                    _sess.setAttribute(arg0, arg1);
219:                else
220:                    _psess.setAttribute(arg0, arg1,
221:                            PortletSession.APPLICATION_SCOPE);
222:
223:            }
224:
225:            /* (non-Javadoc)
226:             * @see javax.servlet.http.HttpSession#setMaxInactiveInterval(int)
227:             */
228:            public void setMaxInactiveInterval(int arg0) {
229:                if (_sess != null)
230:                    _sess.setMaxInactiveInterval(arg0);
231:                else
232:                    _psess.setMaxInactiveInterval(arg0);
233:
234:            }
235:
236:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.