Source Code Cross Referenced for BaseDiscRackEventGateway.java in  » J2EE » Enhydra-Demos » barracudaDiscRack » presentation » 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 » Enhydra Demos » barracudaDiscRack.presentation 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Enhydra Java Application Server Project
003:         *
004:         * The contents of this file are subject to the Enhydra Public License
005:         * Version 1.1 (the "License"); you may not use this file except in
006:         * compliance with the License. You may obtain a copy of the License on
007:         * the Enhydra web site ( http://www.enhydra.org/ ).
008:         *
009:         * Software distributed under the License is distributed on an "AS IS"
010:         * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
011:         * the License for the specific terms governing rights and limitations
012:         * under the License.
013:         *
014:         * The Initial Developer of the Enhydra Application Server is Lutris
015:         * Technologies, Inc. The Enhydra Application Server and portions created
016:         * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
017:         * All Rights Reserved.
018:         *
019:         * Contributor(s):
020:         *
021:         * $Id: BaseDiscRackEventGateway.java,v 1.1 2006-09-11 12:30:36 sinisa Exp $
022:         */
023:
024:        package barracudaDiscRack.presentation;
025:
026:        // import disc rack specifics
027:        import barracudaDiscRack.presentation.personMgmt.events.*;
028:        import barracudaDiscRack.business.person.*;
029:
030:        // import Enhydra specifics
031:        import com.lutris.appserver.server.httpPresentation.*;
032:        import com.lutris.appserver.server.Enhydra;
033:        import com.lutris.util.KeywordValueException;
034:        import com.lutris.logging.*;
035:
036:        // import barracuda specifics
037:        import org.barracudamvc.core.event.*;
038:
039:        public class BaseDiscRackEventGateway extends DefaultEventGateway {
040:
041:            //------------------------------------------------------------
042:            //  BasePO functions
043:            //------------------------------------------------------------
044:
045:            /**
046:             * Initialise the Enhydra PO session data from the event context
047:             *
048:             * @param EventContext
049:             */
050:            protected void initUsingContext(EventContext context)
051:                    throws EventException {
052:                try {
053:                    this .myComms = (HttpPresentationComms) context
054:                            .getState(ApplicationGateway.EXTERNAL_CONTEXT_OBJ_NAME);
055:                    this .initSessionData(this .myComms);
056:                } catch (ClassCastException ex) {
057:                    String errMsg = "ERROR: External Context object is NOT a HttpPresentationComms object. Cannot function";
058:                    throw (new EventException(errMsg, ex));
059:                } catch (DiscRackPresentationException ex) {
060:                    String errMsg = "ERROR: Could not get session data from session:";
061:                    throw (new EventException(errMsg, ex));
062:                }
063:            }
064:
065:            /**
066:             * Gets HttpPresentation object
067:             *
068:             * @return The saved comms objects
069:             * to whichever subclass needs it
070:             */
071:            public HttpPresentationComms getComms() {
072:                return this .myComms;
073:            }
074:
075:            /**
076:             * Gets the session data
077:             *
078:             * @return session data
079:             */
080:            public DiscRackSessionData getSessionData() {
081:                return this .mySessionData;
082:            }
083:
084:            /**
085:             * Sets the user into the session
086:             *
087:             * @param thePerson, the person to be set in the session
088:             * @exception DiscRackPresentationException
089:             */
090:            public void setUser(Person thePerson)
091:                    throws DiscRackPresentationException {
092:                this .getSessionData().setUser(thePerson);
093:            }
094:
095:            /**
096:             * Gets the user from the session
097:             *
098:             * @return the person object in the session
099:             */
100:            public Person getUser() {
101:                return this .getSessionData().getUser();
102:            }
103:
104:            /**
105:             * Method to remove the current user from the session
106:             */
107:            public void removeUserFromSession() {
108:                this .getSessionData().removeUser();
109:            }
110:
111:            /**
112:             * Method to get or create the AgSessionData object from the user session
113:             * This object is saved in the EbrokerPresentation object
114:             *
115:             * @param HttpPresentationComms
116:             * @exception Exception
117:             */
118:            protected void initSessionData(HttpPresentationComms comms)
119:                    throws DiscRackPresentationException {
120:                this .myComms = comms;
121:
122:                try {
123:                    Object obj = comms.sessionData
124:                            .get(DiscRackSessionData.SESSION_KEY);
125:                    // If we found the session data, save it in a private data member
126:                    if (null != obj) {
127:                        this .mySessionData = (DiscRackSessionData) obj;
128:                    } else {
129:                        // If no session data was found, create a new session data instance
130:                        this .mySessionData = new DiscRackSessionData();
131:                        comms.sessionData.set(DiscRackSessionData.SESSION_KEY,
132:                                this .mySessionData);
133:                    }
134:                } catch (KeywordValueException ex) {
135:                    writeDebugMsg("Problem getting session data from session: "
136:                            + ex.getMessage());
137:                }
138:            }
139:
140:            /**
141:             * Method to write a debugging message to the debug log
142:             * channel when the DEBUG flag is turned on
143:             *
144:             * @param msg The message to write to the DEBUG log channel
145:             */
146:            public static void writeDebugMsg(String msg) {
147:                Enhydra.getLogChannel().write(Logger.DEBUG, msg);
148:            }
149:
150:            /**
151:             * Saved input and output context, and session data
152:             */
153:            private HttpPresentationComms myComms = null;
154:            private DiscRackSessionData mySessionData = null;
155:
156:            /**
157:             * Reference to the person logged in to the session
158:             */
159:            private Person myPerson = null;
160:
161:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.