Source Code Cross Referenced for EventRequestPool.java in  » Portal » Open-Portal » com » sun » portal » portlet » impl » 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 » Open Portal » com.sun.portal.portlet.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* $Id: EventRequestPool.java,v 1.6 2006/08/03 09:58:04 dg154973 Exp $
002:         * Copyright 2004-2005 Sun Microsystems, Inc.  All rights reserved.
003:         * Use is subject to license terms.
004:         */
005:        package com.sun.portal.portlet.impl;
006:
007:        import com.sun.portal.common.pool.ObjectManager;
008:        import com.sun.portal.common.pool.ObjectPool;
009:        import com.sun.portal.portletappengine.ipc.EventRequest;
010:        import com.sun.portal.portletcontainercommon.PortletContainerConstants;
011:        import com.sun.portal.portletcontainercommon.PortletContainerEventRequest;
012:        import com.sun.portal.portletcontainercommon.PortletContainerEventResponse;
013:        import com.sun.portal.portletcontainercommon.descriptor.PortletDescriptor;
014:
015:        import javax.servlet.ServletContext;
016:        import javax.servlet.http.HttpServletRequest;
017:        import javax.servlet.http.HttpServletResponse;
018:        import javax.portlet.PortletContext;
019:        import javax.portlet.PortalContext;
020:        import java.io.ByteArrayInputStream;
021:        import java.util.logging.Level;
022:        import java.util.logging.Logger;
023:
024:        public class EventRequestPool extends ObjectPool {
025:
026:            private static Logger logger = null;
027:
028:            private static class EventRequestPoolManager implements 
029:                    ObjectManager {
030:
031:                //SecurityManager _securityManager = null;
032:                private static Logger logger;
033:
034:                // constructor
035:                public EventRequestPoolManager(ServletContext context,
036:                        Logger logger) {
037:                    this .logger = logger;
038:                }
039:
040:                /**
041:                 * Creates a new object.
042:                 * <P>
043:                 * @param param Passed in params if needed.
044:                 */
045:                public Object createObject(Object param) {
046:                    EventRequestImpl aReq = new EventRequestImpl();
047:
048:                    if (logger.isLoggable(Level.INFO)) {
049:                        logger
050:                                .log(Level.INFO,
051:                                        "PorletRequestPool.createObject(): created object");
052:                    }
053:
054:                    return aReq;
055:                }
056:
057:                /**
058:                 * Destroys an object.
059:                 */
060:                public void destroyObject(Object o) {
061:                    //do nothing
062:                }
063:            }
064:
065:            // constructor
066:            public EventRequestPool(ServletContext context, int minSize,
067:                    int maxSize, boolean overflow, int partitionSize, Logger log) {
068:
069:                super (new EventRequestPoolManager(context, logger), minSize,
070:                        maxSize, overflow, partitionSize);
071:                logger = log;
072:            }
073:
074:            /**
075:             * Obtains an portlet request object from the pool.
076:             * <P>
077:             * @param req The <code>HttpServletRequest</code> object
078:             * @param res The <code>HttpServletResponse</code> object
079:             * <P>
080:             * @return <code>ActionRequest</code>
081:             */
082:            public EventRequest obtainObject(HttpServletRequest req,
083:                    HttpServletResponse res,
084:                    PortletContainerEventRequest pceRequest,
085:                    PortletContainerEventResponse pceResponse,
086:                    PortletContext context, PortalContext portalContext,
087:                    PortletDescriptor pDescriptor) {
088:
089:                if (logger.isLoggable(Level.INFO)) {
090:                    logger.log(Level.INFO,
091:                            "EventRequestPool.obtainerObject(): obtained");
092:                }
093:
094:                EventRequestImpl eventRequest = (EventRequestImpl) (getPool()
095:                        .obtainObject(null));
096:                eventRequest.init(req, res, pceRequest, pceResponse, context,
097:                        portalContext, pDescriptor);
098:
099:                String evtName = (String) req
100:                        .getAttribute(PortletContainerConstants.EVENT_NAME);
101:                eventRequest.setEventName(evtName);
102:                byte[] serializedData = (byte[]) req
103:                        .getAttribute(PortletContainerConstants.EVENT_DATA);
104:                ByteArrayInputStream evtStream = null;
105:                //serializedData can be in case of event Failure
106:                if (serializedData != null)
107:                    evtStream = new ByteArrayInputStream(serializedData);
108:                if (evtStream != null)
109:                    evtStream.mark(0);
110:                eventRequest.setEventStream(evtStream);
111:
112:                return (EventRequestImpl) eventRequest;
113:            }
114:
115:            /**
116:             * Releases an object back to the pool.
117:             *
118:             * @param <code>ActionRequest</code>
119:             */
120:            public void releaseObject(EventRequest aReq) {
121:                ((EventRequestImpl) aReq).clear();
122:                getPool().releaseObject(aReq);
123:
124:                if (logger.isLoggable(Level.INFO)) {
125:                    logger.log(Level.INFO,
126:                            "ActionRequestPool.releaseObject(): released");
127:                }
128:            }
129:
130:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.