Source Code Cross Referenced for AbstractSessionComponent.java in  » Content-Management-System » apache-lenya-2.0 » org » apache » cocoon » webapps » session » components » 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 » Content Management System » apache lenya 2.0 » org.apache.cocoon.webapps.session.components 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         * 
009:         *      http://www.apache.org/licenses/LICENSE-2.0
010:         * 
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:        package org.apache.cocoon.webapps.session.components;
018:
019:        import java.io.IOException;
020:        import java.util.Map;
021:
022:        import org.apache.avalon.excalibur.pool.Recyclable;
023:        import org.apache.avalon.framework.component.Component;
024:        import org.apache.avalon.framework.component.ComponentException;
025:        import org.apache.avalon.framework.component.ComponentManager;
026:        import org.apache.avalon.framework.component.Composable;
027:        import org.apache.avalon.framework.component.Recomposable;
028:        import org.apache.avalon.framework.logger.AbstractLogEnabled;
029:        import org.apache.cocoon.ProcessingException;
030:        import org.apache.cocoon.components.RequestLifecycleComponent;
031:        import org.apache.cocoon.environment.ObjectModelHelper;
032:        import org.apache.cocoon.environment.Request;
033:        import org.apache.cocoon.environment.Response;
034:        import org.apache.cocoon.environment.SourceResolver;
035:        import org.apache.cocoon.webapps.session.ContextManager;
036:        import org.apache.cocoon.webapps.session.FormManager;
037:        import org.apache.cocoon.webapps.session.SessionManager;
038:        import org.apache.cocoon.webapps.session.TransactionManager;
039:        import org.xml.sax.SAXException;
040:
041:        /**
042:         * The base class for own components
043:         * This is only here for compatibility
044:         * 
045:         * @deprecated Lookup the components yourself and use contextualizable to get the
046:         *             current object model
047:         * 
048:         * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
049:         * @deprecated This block is deprecated and will be removed in future versions.
050:         * @version CVS $Id: AbstractSessionComponent.java 433543 2006-08-22 06:22:54Z crossley $
051:         */
052:        public abstract class AbstractSessionComponent extends
053:                AbstractLogEnabled implements  Component, Composable,
054:                Recomposable, Recyclable, RequestLifecycleComponent {
055:
056:            private SessionManager sessionManager;
057:            private FormManager formManager;
058:            private ContextManager contextManager;
059:            private TransactionManager transactionManager;
060:
061:            protected ComponentManager manager;
062:
063:            /** The current object model */
064:            protected Map objectModel;
065:
066:            /** The current source resolver */
067:            protected SourceResolver resolver;
068:
069:            protected Request request;
070:            protected Response response;
071:
072:            /**
073:             * Composer interface. Get the Avalon ComponentManager.
074:             */
075:            public void compose(ComponentManager manager)
076:                    throws ComponentException {
077:                this .manager = manager;
078:            }
079:
080:            /**
081:             * Recomposable
082:             */
083:            public void recompose(ComponentManager componentManager)
084:                    throws ComponentException {
085:                this .recycle();
086:                this .manager = componentManager;
087:            }
088:
089:            /**
090:             * Set the <code>SourceResolver</code>, objectModel <code>Map</code>,
091:             * used to process the request.
092:             *  Set up the SessionManager component.
093:             *  This method is automatically called for each request. Do not invoke
094:             *  this method by hand.
095:             */
096:            public void setup(SourceResolver resolver, Map objectModel)
097:                    throws ProcessingException, SAXException, IOException {
098:                this .objectModel = objectModel;
099:                this .resolver = resolver;
100:                this .request = ObjectModelHelper.getRequest(objectModel);
101:                this .response = ObjectModelHelper.getResponse(objectModel);
102:            }
103:
104:            /**
105:             * Get the SessionManager component
106:             */
107:            protected SessionManager getSessionManager()
108:                    throws ProcessingException {
109:                if (this .sessionManager == null) {
110:                    try {
111:                        this .sessionManager = (SessionManager) this .manager
112:                                .lookup(SessionManager.ROLE);
113:                    } catch (ComponentException ce) {
114:                        throw new ProcessingException(
115:                                "Error during lookup of SessionManager component.",
116:                                ce);
117:                    }
118:                }
119:                return this .sessionManager;
120:            }
121:
122:            /**
123:             * Get the ContextManager component
124:             */
125:            protected ContextManager getContextManager()
126:                    throws ProcessingException {
127:                if (this .contextManager == null) {
128:                    try {
129:                        this .contextManager = (ContextManager) this .manager
130:                                .lookup(ContextManager.ROLE);
131:                    } catch (ComponentException ce) {
132:                        throw new ProcessingException(
133:                                "Error during lookup of ContextManager component.",
134:                                ce);
135:                    }
136:                }
137:                return this .contextManager;
138:            }
139:
140:            /**
141:             * Get the ContextManager component
142:             */
143:            protected TransactionManager getTransactionManager()
144:                    throws ProcessingException {
145:                if (this .transactionManager == null) {
146:                    try {
147:                        this .transactionManager = (TransactionManager) this .manager
148:                                .lookup(TransactionManager.ROLE);
149:                    } catch (ComponentException ce) {
150:                        throw new ProcessingException(
151:                                "Error during lookup of TransactionManager component.",
152:                                ce);
153:                    }
154:                }
155:                return this .transactionManager;
156:            }
157:
158:            /**
159:             * Get the FormManager component
160:             */
161:            protected FormManager getFormManager() throws ProcessingException {
162:                if (this .formManager == null) {
163:                    try {
164:                        this .formManager = (FormManager) this .manager
165:                                .lookup(FormManager.ROLE);
166:                    } catch (ComponentException ce) {
167:                        throw new ProcessingException(
168:                                "Error during lookup of FormManager component.",
169:                                ce);
170:                    }
171:                }
172:                return this .formManager;
173:            }
174:
175:            /**
176:             * Recycle
177:             */
178:            public void recycle() {
179:                if (this .manager != null) {
180:                    this .manager.release((Component) this .sessionManager);
181:                    this .manager.release((Component) this .formManager);
182:                    this .manager.release((Component) this .contextManager);
183:                    this .manager.release((Component) this.transactionManager);
184:                }
185:                this.transactionManager = null;
186:                this.sessionManager = null;
187:                this.formManager = null;
188:                this.contextManager = null;
189:                this.objectModel = null;
190:                this.resolver = null;
191:                this.request = null;
192:                this.response = null;
193:            }
194:
195:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.