Source Code Cross Referenced for BaseMultithreadedChannel.java in  » Portal » uPortal_rel-2-6-1-GA » org » jasig » portal » channels » 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 » Portal » uPortal_rel 2 6 1 GA » org.jasig.portal.channels 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* Copyright 2001 The JA-SIG Collaborative.  All rights reserved.
002:         *  See license distributed with this file and
003:         *  available online at http://www.uportal.org/license.html
004:         */
005:
006:        package org.jasig.portal.channels;
007:
008:        import java.util.Collections;
009:        import java.util.HashMap;
010:        import java.util.Map;
011:
012:        import org.apache.commons.logging.Log;
013:        import org.apache.commons.logging.LogFactory;
014:        import org.jasig.portal.ChannelRuntimeData;
015:        import org.jasig.portal.ChannelRuntimeProperties;
016:        import org.jasig.portal.ChannelStaticData;
017:        import org.jasig.portal.IMultithreadedChannel;
018:        import org.jasig.portal.PortalEvent;
019:        import org.jasig.portal.PortalException;
020:        import org.xml.sax.ContentHandler;
021:
022:        /**
023:         * A base class from which channels implementing IMultithreadedChannel interface can be derived.
024:         * Use this only if you are familiar with the IMultithreadedChannel interface.
025:         * Channels that extend BaseMultithreadedChannel typically only need to override the renderXML method
026:         * and should not contain any non-static member variables.
027:         * @author Ken Weiner, kweiner@unicon.net
028:         * @version $Revision: 35614 $
029:         */
030:        public abstract class BaseMultithreadedChannel implements 
031:                IMultithreadedChannel {
032:            protected static Map channelStateMap;
033:
034:            /**
035:             * A Commons Logging log instance which will log as the runtime class extending
036:             * this BaseChannel.  Channels extending BaseChannel can use this Log instance
037:             * rather than instantiating their own.
038:             */
039:            protected Log log = LogFactory.getLog(getClass());
040:
041:            /**
042:             * The channel's state including the static data, runtime data,
043:             * portal event, and a channelData map which is analagous to the
044:             * session for a servlet - the channel can stash objects in it.
045:             */
046:            protected class ChannelState {
047:                private ChannelStaticData staticData = null;
048:                private ChannelRuntimeData runtimeData = null;
049:                private PortalEvent portalEvent = null;
050:                private Map channelData = new HashMap();
051:
052:                public ChannelStaticData getStaticData() {
053:                    return this .staticData;
054:                }
055:
056:                public ChannelRuntimeData getRuntimeData() {
057:                    return this .runtimeData;
058:                }
059:
060:                public PortalEvent getPortalEvent() {
061:                    return this .portalEvent;
062:                }
063:
064:                public Map getChannelData() {
065:                    return this .channelData;
066:                }
067:
068:                public void setStaticData(ChannelStaticData sd) {
069:                    this .staticData = sd;
070:                }
071:
072:                public void setRuntimeData(ChannelRuntimeData rd) {
073:                    this .runtimeData = rd;
074:                }
075:
076:                public void setPortalEvent(PortalEvent ev) {
077:                    this .portalEvent = ev;
078:                }
079:
080:                public void setChannelData(Map cd) {
081:                    this .channelData = cd;
082:                }
083:            }
084:
085:            static {
086:                channelStateMap = Collections.synchronizedMap(new HashMap());
087:            }
088:
089:            /**
090:             * Sets channel runtime properties.
091:             * @param uid a unique ID used to identify the state of the channel
092:             * @return channel runtime properties
093:             */
094:            public ChannelRuntimeProperties getRuntimeProperties(String uid) {
095:                return new ChannelRuntimeProperties();
096:            }
097:
098:            /**
099:             * React to portal events.
100:             * Removes channel state from the channel state map when the session expires.
101:             * @param ev a portal event
102:             * @param uid a unique ID used to identify the state of the channel
103:             */
104:            public void receiveEvent(PortalEvent ev, String uid) {
105:                ChannelState channelState = (ChannelState) channelStateMap
106:                        .get(uid);
107:                if (channelState != null) {
108:                    channelState.setPortalEvent(ev);
109:                    if (ev.getEventNumber() == PortalEvent.SESSION_DONE) {
110:                        channelStateMap.remove(uid); // Clean up
111:                    }
112:                }
113:            }
114:
115:            /**
116:             * Sets the channel static data.
117:             * @param sd the channel static data
118:             * @param uid a unique ID used to identify the state of the channel
119:             * @throws org.jasig.portal.PortalException
120:             */
121:            public void setStaticData(ChannelStaticData sd, String uid)
122:                    throws PortalException {
123:                ChannelState channelState = new ChannelState();
124:                channelState.setStaticData(sd);
125:                channelStateMap.put(uid, channelState);
126:            }
127:
128:            /**
129:             * Sets the channel runtime data.
130:             * @param rd the channel runtime data
131:             * @param uid a unique ID used to identify the state of the channel
132:             * @throws org.jasig.portal.PortalException
133:             */
134:            public void setRuntimeData(ChannelRuntimeData rd, String uid)
135:                    throws PortalException {
136:                ChannelState channelState = (ChannelState) channelStateMap
137:                        .get(uid);
138:                channelState.setRuntimeData(rd);
139:            }
140:
141:            /**
142:             * Render nothing.
143:             * @param out the content handler to which the channel sends SAX events
144:             * @param uid a unique ID used to identify the state of the channel
145:             * @throws org.jasig.portal.PortalException
146:             */
147:            public void renderXML(ContentHandler out, String uid)
148:                    throws PortalException {
149:            }
150:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.