portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed-2/portal/src/webapp/WEB-INF/conf jetspeed.properties
Date Mon, 12 Jan 2004 23:47:01 GMT
taylor      2004/01/12 15:47:01

  Modified:    portal/src/java/org/apache/jetspeed
                        JetspeedPortalContext.java PortalContext.java
               portal/src/java/org/apache/jetspeed/container/invoker
                        AbstractPortletInvokerFactory.java
                        JetspeedPortletInvoker.java
                        LocalPortletInvoker.java
                        PortletInvokerFactoryImpl.java
                        ServletPortletInvoker.java
                        ServletPortletInvokerFactory.java
               portal/src/webapp/WEB-INF/conf jetspeed.properties
  Log:
  * The servlet mapping name of the JetspeedContainerServlet no longer hard-coded.
    It is configured via jetspeed.properties and defaults to "/container "
  * enhanced PortalContext to get default property values
  
  Revision  Changes    Path
  1.4       +6 -1      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/JetspeedPortalContext.java
  
  Index: JetspeedPortalContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/JetspeedPortalContext.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JetspeedPortalContext.java	31 Dec 2003 09:46:35 -0000	1.3
  +++ JetspeedPortalContext.java	12 Jan 2004 23:47:00 -0000	1.4
  @@ -118,6 +118,11 @@
           return configuration.getString(key);
       }
   
  +    public String getConfigurationProperty(String key, String defaultValue)
  +    {
  +        return configuration.getString(key, defaultValue);
  +    }
  +
       /**
        * Set the configuration properties for this Jetspeed engine context.
        *
  
  
  
  1.3       +2 -1      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/PortalContext.java
  
  Index: PortalContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/PortalContext.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PortalContext.java	30 Dec 2003 06:37:39 -0000	1.2
  +++ PortalContext.java	12 Jan 2004 23:47:00 -0000	1.3
  @@ -70,6 +70,7 @@
       public void setConfiguration(Configuration configuration);
   
       public String getConfigurationProperty(String key);
  +    public String getConfigurationProperty(String key, String defaultValue);
   
       public void setAttribute(String name, Object value);
       public Object getAttribute(String name);
  
  
  
  1.6       +3 -3      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/invoker/AbstractPortletInvokerFactory.java
  
  Index: AbstractPortletInvokerFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/invoker/AbstractPortletInvokerFactory.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AbstractPortletInvokerFactory.java	12 Jan 2004 06:42:43 -0000	1.5
  +++ AbstractPortletInvokerFactory.java	12 Jan 2004 23:47:01 -0000	1.6
  @@ -71,8 +71,8 @@
       /** The pool of local portlet invokers */ 
       protected ObjectPool pool;
       
  -    protected String invokerClass;    
  -    protected int invokerPoolSize = 30;
  +    protected String invokerClass = null;    
  +    protected int invokerPoolSize;
       
       public AbstractPortletInvokerFactory()
       {
  
  
  
  1.3       +14 -3     jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/invoker/JetspeedPortletInvoker.java
  
  Index: JetspeedPortletInvoker.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/invoker/JetspeedPortletInvoker.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JetspeedPortletInvoker.java	12 Jan 2004 06:42:43 -0000	1.2
  +++ JetspeedPortletInvoker.java	12 Jan 2004 23:47:01 -0000	1.3
  @@ -62,7 +62,6 @@
    * JetspeedPortletInvoker extends Pluto's portlet invoker and extends it
    * with lifecycle management. Portlet Invokers can be pooled, and activated
    * and passivated per request cycle.
  - * TODO: I'd like to refactor activate and passivate, hopefully with a IOC service framework
    *
    * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
    * @version $Id$
  @@ -77,7 +76,19 @@
        * @param servletConfig The servlet configuration of the portal. 
        * @param containerServlet
        */
  -    void activate(PortletDefinition portletDefinition, ServletConfig servletConfig); //,
String entryPoint);
  +    void activate(PortletDefinition portletDefinition, ServletConfig servletConfig);
  +
  +    /**
  +     * Activating an invoker makes it ready to invoke portlets.
  +     * If an invoker's state is not activated, it can not invoke.
  +     * This second signature allows for activating with an extra property.
  +     * 
  +     * @param portletDefinition The portlet's definition that is being invoked.
  +     * @param servletConfig The servlet configuration of the portal. 
  +     * @param property Implementation specific property
  +     * @param containerServlet
  +     */
  +    void activate(PortletDefinition portletDefinition, ServletConfig servletConfig, String
property);
       
       /**
        * Passivates an invoker, freeing it back to the invoker pool.
  
  
  
  1.5       +9 -1      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/invoker/LocalPortletInvoker.java
  
  Index: LocalPortletInvoker.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/invoker/LocalPortletInvoker.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LocalPortletInvoker.java	12 Jan 2004 06:42:43 -0000	1.4
  +++ LocalPortletInvoker.java	12 Jan 2004 23:47:01 -0000	1.5
  @@ -259,5 +259,13 @@
           Thread.currentThread().setContextClassLoader(oldLoader);                 
   
       }
  +
  +    /* (non-Javadoc)
  +     * @see org.apache.jetspeed.container.invoker.JetspeedPortletInvoker#activate(org.apache.pluto.om.portlet.PortletDefinition,
javax.servlet.ServletConfig, java.lang.String)
  +     */
  +    public void activate(PortletDefinition portletDefinition, ServletConfig servletConfig,
String servletMappingName)
  +    {
  +        activate(portletDefinition, servletConfig);
  +    }
       
   }
  
  
  
  1.8       +3 -3      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/invoker/PortletInvokerFactoryImpl.java
  
  Index: PortletInvokerFactoryImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/invoker/PortletInvokerFactoryImpl.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PortletInvokerFactoryImpl.java	8 Jan 2004 23:25:13 -0000	1.7
  +++ PortletInvokerFactoryImpl.java	12 Jan 2004 23:47:01 -0000	1.8
  @@ -159,14 +159,14 @@
           try
           {
               invoker = servletInvokerFactory.getPortletInvoker();
  -            invoker.activate(portletDefinition, servletConfig);            
  +            invoker.activate(portletDefinition, servletConfig, servletInvokerFactory.getServletMappingName());
           
               return invoker;
           }
           catch (Throwable t)
           {
               log.error("failed to create SERVLET invoker, using default", t);
               invoker = new ServletPortletInvoker();
  -            invoker.activate(portletDefinition, servletConfig);
  +            invoker.activate(portletDefinition, servletConfig, servletInvokerFactory.getServletMappingName());
               return invoker;
           }
       }
  
  
  
  1.10      +13 -6     jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/invoker/ServletPortletInvoker.java
  
  Index: ServletPortletInvoker.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/invoker/ServletPortletInvoker.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ServletPortletInvoker.java	12 Jan 2004 06:42:43 -0000	1.9
  +++ ServletPortletInvoker.java	12 Jan 2004 23:47:01 -0000	1.10
  @@ -91,14 +91,13 @@
    */
   public class ServletPortletInvoker implements JetspeedPortletInvoker
   {
  -    public static final String MVC_ENTRY_SERVLET = "/container";
  -
       private final static Log log = LogFactory.getLog(ServletPortletInvoker.class);
   
       protected ServletContext jetspeedContext;
       protected ServletConfig jetspeedConfig;
       protected PortletDefinition portletDefinition;
       protected boolean activated = false;
  +    protected String servletMappingName;
   
       /* (non-Javadoc)
        * @see org.apache.jetspeed.container.invoker.JetspeedPortletInvoker#passivate()
  @@ -127,6 +126,14 @@
           activated = true;
       }
   
  +    /* (non-Javadoc)
  +     * @see org.apache.jetspeed.container.invoker.JetspeedPortletInvoker#activate(org.apache.pluto.om.portlet.PortletDefinition,
javax.servlet.ServletConfig, java.lang.String)
  +     */
  +    public void activate(PortletDefinition portletDefinition, ServletConfig servletConfig,
String servletMappingName)
  +    {
  +        this.servletMappingName = servletMappingName;
  +        activate(portletDefinition, servletConfig);
  +    }
   
       public ServletPortletInvoker()
       {
  @@ -198,14 +205,14 @@
               throw new PortletException();
           }
   
  -        RequestDispatcher dispatcher = appContext.getRequestDispatcher(MVC_ENTRY_SERVLET);
  +        RequestDispatcher dispatcher = appContext.getRequestDispatcher(servletMappingName);
           if (null == dispatcher)
           {
               String message =
                   "Failed to get Request Dispatcher for Portlet Application: "
                       + portletApplicationName
                       + ", servlet: "
  -                    + MVC_ENTRY_SERVLET;
  +                    + servletMappingName;
               log.error(message);
               throw new PortletException(message);
           }
  @@ -226,7 +233,7 @@
           catch (Exception e)
           {
               String message =
  -                "Failed to dispatch.include for Portlet Application: " + portletApplicationName
+ ", servlet: " + MVC_ENTRY_SERVLET;
  +                "Failed to dispatch.include for Portlet Application: " + portletApplicationName
+ ", servlet: " + servletMappingName;
               log.error(message, e);
               throw new PortletException(message, e);
           }
  
  
  
  1.3       +11 -4     jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/invoker/ServletPortletInvokerFactory.java
  
  Index: ServletPortletInvokerFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/invoker/ServletPortletInvokerFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ServletPortletInvokerFactory.java	12 Jan 2004 06:42:43 -0000	1.2
  +++ ServletPortletInvokerFactory.java	12 Jan 2004 23:47:01 -0000	1.3
  @@ -65,16 +65,23 @@
   {
       public final static String INVOKER_SERVLET = "factory.invoker.servlet";
       public final static String INVOKER_SERVLET_POOL_SIZE = "factory.invoker.servlet.pool.size";
  -    public final static String INVOKER_SERVLET_CONTEXT = "factory.invoker.servlet.context";
  +    public final static String INVOKER_SERVLET_MAPPING_NAME = "factory.invoker.servlet.mapping.name";
  +    public final static String DEFAULT_MAPPING_NAME = "/container";
  +    
  +    protected String servletMappingName = null;
       
       public ServletPortletInvokerFactory(PortalContext pc)
       {    
           super();                
           String servletInvokerClass = pc.getConfigurationProperty(INVOKER_SERVLET);    
   
  -        int servletInvokerPoolSize = pc.getConfiguration().getInt(INVOKER_SERVLET_POOL_SIZE);
  -        //String servletInvokerClass = pc.getConfigurationProperty(INVOKER_SERVLET);
  +        int servletInvokerPoolSize = pc.getConfiguration().getInt(INVOKER_SERVLET_POOL_SIZE,
50);
  +        servletMappingName = pc.getConfigurationProperty(INVOKER_SERVLET_MAPPING_NAME,
DEFAULT_MAPPING_NAME);
           init(servletInvokerClass, servletInvokerPoolSize);                
       }
       
  +    public String getServletMappingName()
  +    {
  +        return servletMappingName;
  +    }
       
   }
  
  
  
  1.25      +2 -2      jakarta-jetspeed-2/portal/src/webapp/WEB-INF/conf/jetspeed.properties
  
  Index: jetspeed.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/webapp/WEB-INF/conf/jetspeed.properties,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- jetspeed.properties	12 Jan 2004 22:49:04 -0000	1.24
  +++ jetspeed.properties	12 Jan 2004 23:47:01 -0000	1.25
  @@ -73,7 +73,7 @@
   factory.invoker.servlet.pool.size = 50
   factory.invoker.local = org.apache.jetspeed.container.invoker.LocalPortletInvoker
   factory.invoker.local.pool.size = 50
  -factory.invoker.servlet.context = /container
  +factory.invoker.servlet.mapping.name = /container
   
   ## Pluto Factory
   plutofactory.javax.portlet.ActionRequest = org.apache.pluto.factory.impl.ActionRequestFactoryImpl
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message