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


001:        /**
002:         * $Id: GenericPortletProvisionListener.java,v 1.5 2007/02/06 22:10:19 pm95875 Exp $
003:         * Copyright 2005 Sun Microsystems, Inc. All
004:         * rights reserved. Use of this product is subject
005:         * to license terms. Federal Acquisitions:
006:         * Commercial Software -- Government Users
007:         * Subject to Standard License Terms and
008:         * Conditions.
009:         *
010:         * Sun, Sun Microsystems, the Sun logo, and Sun ONE
011:         * are trademarks or registered trademarks of Sun Microsystems,
012:         * Inc. in the United States and other countries.
013:         */package com.sun.portal.portlet.service.provision;
014:
015:        import javax.servlet.ServletContext;
016:        import javax.portlet.PortletContext;
017:
018:        /**
019:         * A convienence class implementing PortletProvisionListener.
020:         * Listeners are configured for a portlet in sun-portlet.xml file. Methods on
021:         * these listeners are invoked everytime the community including the portlet changes its state.
022:         * Framework initializes the instance with the right PortletContext in the init() method.
023:         */
024:        public class GenericPortletProvisionListener implements 
025:                PortletProvisionListener {
026:            private PortletContext _portletContext;
027:            private ServletContext _servletContext;
028:            private PortletProvisionPreferences _portletProvisionPreferences;
029:
030:            /**
031:             * Called by container when an instance is created. When overwritten, super.init(context) must 
032:             * be called to initialize it correctly.
033:             * @param pc portlet context
034:             * @exception com.sun.portal.portlet.service.provision.PortletProvisionException
035:             */
036:            public void init(PortletContext pc)
037:                    throws PortletProvisionException {
038:                _portletContext = pc;
039:                _servletContext = null;
040:            }
041:
042:            /**
043:             * Called by container when an instance is created. When overwritten, super.init(context) must 
044:             * be called to initialize it correctly.
045:             * @param pc portlet context
046:             * @param sc servlet context
047:             * @exception com.sun.portal.portlet.service.provision.PortletProvisionException
048:             */
049:            public void init(PortletContext pc, javax.servlet.ServletContext sc)
050:                    throws PortletProvisionException {
051:                _portletContext = pc;
052:                _servletContext = sc;
053:            }
054:
055:            /**
056:             * Returns the Portlet Context
057:             * @return PortletContext
058:             */
059:            public PortletContext getPortletContext() {
060:                return _portletContext;
061:            }
062:
063:            /**
064:             * Getter for property _servletContext.
065:             * @return Value of property _servletContext.
066:             */
067:            public ServletContext getServletContext() {
068:                return this ._servletContext;
069:            }
070:
071:            /**
072:             * Method called when an instance of the portlet, for which this listener is configured, is added to the community.
073:             * For backward compatibility, handleEvent calls this method when the event type is EVENT_TYPE_CREATED.
074:             * We recommend not to use this method and instead overwrite the default implementation of handleEvent 
075:             * to handle all community event types.
076:             * @deprecated Use handleEvent instead
077:             * @param event provisioning event
078:             * @exception com.sun.portal.portlet.service.provision.PortletProvisionException
079:             */
080:            public void provision(PortletProvisionEvent event)
081:                    throws PortletProvisionException {
082:                // no-op
083:            }
084:
085:            /**
086:             * Method called when an instance of the portlet, for which this listener is configured, is removed from the community.
087:             * For backward compatibility, handleEvent calls this method when the event type is EVENT_TYPE_PURGED.
088:             * We recommend not to use this method and instead overwrite the default implementation of handleEvent 
089:             * to handle all community event types.
090:             * @deprecated Use handleEvent instead
091:             * @param event provisioning event
092:             * @exception com.sun.portal.portlet.service.provision.PortletProvisionException thrown when there is an application error.
093:             */
094:            public void unprovision(PortletProvisionEvent event)
095:                    throws PortletProvisionException {
096:                //no-op
097:            }
098:
099:            /**
100:             * Method called when a provisioning event happens. 
101:             * @param event provisioning event
102:             * @exception com.sun.portal.portlet.service.provision.PortletProvisionException thrown when there is an application error.
103:             */
104:            public void handleProvisionEvent(PortletProvisionEvent event)
105:                    throws PortletProvisionException {
106:                if (event.getType().equals(
107:                        PortletProvisionEvent.EVENT_TYPE_CREATED)) {
108:                    provision(event);
109:                } else if (event.getType().equals(
110:                        PortletProvisionEvent.EVENT_TYPE_DESTROYED)) {
111:                    unprovision(event);
112:                } else {
113:                    // nothing
114:                }
115:            }
116:
117:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.