LifecycleManager.java :  » Portal » Open-Portal » com » sun » portal » portletappengine » Java Open Source

Java Open Source » Portal » Open Portal 
Open Portal » com » sun » portal » portletappengine » LifecycleManager.java
/*
 * Copyright 2002 Sun Microsystems, Inc. All 
 * rights reserved. Use of this product is subject 
 * to license terms. Federal Acquisitions: 
 * Commercial Software -- Government Users 
 * Subject to Standard License Terms and 
 * Conditions. 
 * 
 * Sun, Sun Microsystems, the Sun logo, and Sun ONE 
 * are trademarks or registered trademarks of Sun Microsystems, 
 * Inc. in the United States and other countries. 
 */
package com.sun.portal.portletappengine;

import javax.portlet.Portlet;
import javax.portlet.PortletException;
import javax.portlet.PortletContext;
import javax.portlet.PortalContext;
import javax.portlet.PortletConfig;
import javax.portlet.PreferencesValidator;

import java.util.logging.Logger;

import com.sun.portal.portletcontainercommon.descriptor.PortletAppDescriptor;

/**
 * The lifecycle manager maintains the life cycle of portlets and 
 * other portlet container objects running inside the portlet application 
 * engine. <code>LifecycleManager</code> is a interface that is used by the 
 * <code>PortletAppEngineServlet</code>. 
 **/
public interface LifecycleManager {

    //Prefixes for the name using in the servlet context listeners
    public static final String LIFECYCLE_MANAGER_PREFIX = "lifecycle_manager";
    
    /**
     * Gets the Portlet App Descriptor object. 
     * <P>
     * The <code>PortletAppDescriptor</code> contains the Portlet configuration 
     * information defined in the portlet desployment descriptor,that is,
     * the portlet.xml file.
     * <P>
     * The <code>PortletAppDescriptor</code> stores all the descriptors associated
     * with Portlet Applications. The descriptors include:
     * <P>
     * <UL>
     *   <LI>PortletsDescriptor</LI>
     *   <LI>PortletPreferencesDescriptor</LI>
     *   <LI>SecurityRolesDescriptor</LI>
     *   <LI>SecurityConstraintsDescriptor</LI>
     * </UL>
     *
     * @return the PortletAppDescriptor object
     **/
    public PortletAppDescriptor getDeploymentDescriptor();  

    /**
     * Returns the portlet of the specified portletName.
     * <P>
     * @param portletName The portlet name
     * @return javax.portlet.Portlet a portlet object.
     * @exception javax.portlet.ProletException if an error occurs in 
     * getting the portlet object, or when instantiating the portlet
     * object.
     **/
    public Portlet getPortlet( String portletName ) throws PortletException; 

    /**
     * Removes the portlet of the specified portletName from the
     * lifecycle manager.
     *
     * <P>
     * @param portletName The portlet name
     **/
    public void removePortlet( String portletName );

    /**
     * Returns the portlet config of the specified portletName.
     * <P>
     * @param portletName The portlet name
     * @return javax.portlet.PortletConfig a portlet config
     * object. Returns null if not found.
     **/
    public PortletConfig getPortletConfig( String portletName );

    /**
     * Returns the preferences validator if it is defined in the 
     * descriptor.
     * <P>
     * @param portletName The portlet name
     * @return javax.portlet.PreferencesValidator portlet validator 
     * object. Returns null if not found.
     **/
    public PreferencesValidator getPreferencesValidator( String
                                                        portletName );
    
    /**
     * Removes the portlet config of the specified portletName from the
     * lifecycle manager.
     *
     * <P>
     * @param portletName The portlet name
     **/
    public void removePortletConfig( String portletName );

    /**
     * Returns the PortletContext object.
     * <P>
     * @return A javax.portlet.PortletContext object, used by the caller 
     * to interact with its portlet application.
     **/
    public PortletContext getPortletContext();

    /**
     * Returns the PortalContext object.
     * <P>
     * @return A javax.portlet.PortalContext object, used by the caller 
     * to query for portal information.
     **/
    public PortalContext getPortalContext();

    /**
     * Returns the Logger to log messages.
     * <P>
     * @return A Logger object
     * @see com.sun.portal.common.logging.Logger
     **/
    public Logger getLogger();

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.