01: /*
02: * Copyright 2002 Sun Microsystems, Inc. All
03: * rights reserved. Use of this product is subject
04: * to license terms. Federal Acquisitions:
05: * Commercial Software -- Government Users
06: * Subject to Standard License Terms and
07: * Conditions.
08: *
09: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
10: * are trademarks or registered trademarks of Sun Microsystems,
11: * Inc. in the United States and other countries.
12: */
13:
14: package com.sun.portal.container.portlet.impl;
15:
16: import javax.servlet.ServletContextListener;
17: import javax.servlet.ServletContextEvent;
18: import javax.servlet.ServletContext;
19:
20: import com.sun.portal.portletcontainercommon.PortletContainerConstants;
21: import com.sun.portal.log.common.PortalLogger;
22:
23: import java.util.logging.Logger;
24:
25: public class PortletContainerContextListenerImpl extends
26: PortletContainer implements ServletContextListener {
27:
28: // Create a logger for this class
29: private static Logger debugLogger = PortalLogger
30: .getLogger(PortletContainerContextListenerImpl.class);
31:
32: public void contextInitialized(ServletContextEvent sce) {
33: ServletContext context = sce.getServletContext();
34:
35: debugLogger.info("PSPL_PCCSPCPCI0003");
36:
37: init(context);
38: context.setAttribute(
39: PortletContainerConstants.PORTLET_CONTAINER, this );
40:
41: debugLogger.info("PSPL_PCCSPCPCI0004");
42: }
43:
44: public void contextDestroyed(ServletContextEvent sce) {
45: ServletContext context = sce.getServletContext();
46: context
47: .removeAttribute(PortletContainerConstants.PORTLET_CONTAINER);
48: }
49:
50: }
|