You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by at...@apache.org on 2008/11/01 01:00:00 UTC

svn commit: r709608 - in /portals/pluto/branches/2.0-spi-refactoring: pluto-container-api/src/main/java/org/apache/pluto/ pluto-container-api/src/main/java/org/apache/pluto/core/ pluto-container-api/src/main/java/org/apache/pluto/internal/ pluto-contai...

Author: ate
Date: Fri Oct 31 16:59:59 2008
New Revision: 709608

URL: http://svn.apache.org/viewvc?rev=709608&view=rev
Log:
PLUTO-481 - Pluto 2.0 Refactoring Initiative
See: http://issues.apache.org/jira/browse/PLUTO-481
Adding a new optional container service: PortletContextService
This contains the *runtime* registration methods moved from PortletRegistryService.
As Jetspeed has its own way of handling this, those methods were causing many difficulties to adapt to, so I refactored then as a separate service which Jetspeed simply does *not* implement.
The only usage of this service is within:
- PortletServlet (Jetspeed has its own/different JetspeedContainerServlet and will remain using it)
- DefaultPortletInvokerService (Jetspeed provides its own too)
- PortletWindowThread, getting access to the portlet application classLoader (this is Portal Driver only)

Added:
    portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletContextService.java   (with props)
Modified:
    portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/OptionalContainerServices.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/core/PortletServlet.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/internal/InternalPortletConfig.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/services/PlutoServices.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletInvokerService.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletRegistryService.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/DefaultOptionalContainerServices.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/DefaultPortletInvokerService.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PlutoContainerServices.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletContainerImpl.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletConfigImpl.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventProviderImpl.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletWindowThread.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/view.jsp

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/OptionalContainerServices.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/OptionalContainerServices.java?rev=709608&r1=709607&r2=709608&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/OptionalContainerServices.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/OptionalContainerServices.java Fri Oct 31 16:59:59 2008
@@ -17,6 +17,7 @@
 package org.apache.pluto;
 
 import org.apache.pluto.spi.optional.PortalAdministrationService;
+import org.apache.pluto.spi.optional.PortletContextService;
 import org.apache.pluto.spi.optional.PortletEnvironmentService;
 import org.apache.pluto.spi.optional.PortletInfoService;
 import org.apache.pluto.spi.optional.PortletInvokerService;
@@ -65,6 +66,15 @@
 
 
     /**
+     * Returns the portlet context services implementation
+     * used by the container.
+     *
+     * @return registry service implementation
+     */
+    PortletContextService getPortletContextService();
+
+
+    /**
      * Returns an invoker for the specified PortletWindow.
      *
      * @return an invoker which can be used to service the indicated portlet.

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/core/PortletServlet.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/core/PortletServlet.java?rev=709608&r1=709607&r2=709608&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/core/PortletServlet.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/core/PortletServlet.java Fri Oct 31 16:59:59 2008
@@ -54,9 +54,9 @@
 import org.apache.pluto.spi.FilterManager;
 import org.apache.pluto.spi.optional.AdministrativeRequestListener;
 import org.apache.pluto.spi.optional.PortalAdministrationService;
+import org.apache.pluto.spi.optional.PortletContextService;
 import org.apache.pluto.spi.optional.PortletInvocationEvent;
 import org.apache.pluto.spi.optional.PortletInvocationListener;
-import org.apache.pluto.spi.optional.PortletRegistryService;
 
 /**
  * Portlet Invocation Servlet. This servlet recieves cross context requests from
@@ -98,7 +98,7 @@
     /** The resource serving portlet instance wrapped by this servlet. */
     private ResourceServingPortlet resourceServingPortlet = null;
 
-    private PortletRegistryService registryService;
+    private PortletContextService contextService;
 
     private ContainerInvocationService containerInvocationService;
 
@@ -155,7 +155,7 @@
     {
         if (PlutoServices.getServices() != null) 
         {
-            registryService = PlutoServices.getServices().getPortletRegistryService();
+            contextService = PlutoServices.getServices().getPortletContextService();
             containerInvocationService = PlutoServices.getServices().getContainerInvocationService();
             try
             {
@@ -167,9 +167,10 @@
                     return true;
                 }
 
-                String applicationName = registryService.register(sConfig);
-                portletContext = (InternalPortletContext) registryService.getPortletContext(applicationName);
-                portletConfig = (InternalPortletConfig) registryService.getPortletConfig(applicationName, portletName);
+                String applicationName = contextService.register(sConfig);
+                started = true;
+                portletContext = (InternalPortletContext) contextService.getPortletContext(applicationName);
+                portletConfig = (InternalPortletConfig) contextService.getPortletConfig(applicationName, portletName);
 
             }
             catch (PortletContainerException ex)

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/internal/InternalPortletConfig.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/internal/InternalPortletConfig.java?rev=709608&r1=709607&r2=709608&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/internal/InternalPortletConfig.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/internal/InternalPortletConfig.java Fri Oct 31 16:59:59 2008
@@ -23,8 +23,6 @@
 
 public interface InternalPortletConfig extends PortletConfig {
 
-    public ServletConfig getServletConfig();
-
     public PortletDefinition getPortletDefinition();
 }
 

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/services/PlutoServices.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/services/PlutoServices.java?rev=709608&r1=709607&r2=709608&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/services/PlutoServices.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/services/PlutoServices.java Fri Oct 31 16:59:59 2008
@@ -23,6 +23,7 @@
 import org.apache.pluto.spi.ContainerInvocationService;
 import org.apache.pluto.spi.PortalCallbackService;
 import org.apache.pluto.spi.optional.PortalAdministrationService;
+import org.apache.pluto.spi.optional.PortletContextService;
 import org.apache.pluto.spi.optional.PortletEnvironmentService;
 import org.apache.pluto.spi.optional.PortletInfoService;
 import org.apache.pluto.spi.optional.PortletInvokerService;
@@ -35,9 +36,10 @@
 public class PlutoServices implements ContainerServices
 {
     private ContainerServices provider;
+    
     private static PlutoServices singleton;
 
-    public static ContainerServices getServices()
+    public static PlutoServices getServices()
     {
         return singleton;
     }
@@ -111,4 +113,9 @@
     {
         return provider.getUserInfoService();
     }
+    
+    public PortletContextService getPortletContextService()
+    {
+        return provider.getPortletContextService();
+    }
 }

Added: portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletContextService.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletContextService.java?rev=709608&view=auto
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletContextService.java (added)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletContextService.java Fri Oct 31 16:59:59 2008
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.pluto.spi.optional;
+
+import java.util.Iterator;
+
+import javax.servlet.ServletConfig;
+
+import org.apache.pluto.PortletContainerException;
+import org.apache.pluto.PortletWindow;
+import org.apache.pluto.internal.InternalPortletConfig;
+import org.apache.pluto.internal.InternalPortletContext;
+
+/**
+ * Interface defining the services used by both the Pluto Portal Driver
+ * and the Pluto PortletServlet for registration and access to 
+ * the PortletContexts and ClassLoader of registered Portlet Applications.
+ *
+ * @since 2.0
+ * @version $Id$
+ *
+ */
+public interface PortletContextService
+{
+    /**
+     * Retrieve all registered applications.  This list
+     * will only contain those applications which have
+     * been registered with the container.  Others may
+     * or may not be available within the servers.
+     *
+     * @return iterator of all application descriptors.
+     */
+    Iterator<InternalPortletContext> getPortletContexts();
+
+    /**
+     * Retrieve the InternalPortletContext for the specified portlet application name
+     *
+     * @param applicationName portlet application name
+     * @return portlet context or null if not registered
+     */
+    InternalPortletContext getPortletContext(String applicationName)
+        throws PortletContainerException;
+
+    /**
+     * Retrieve the InternalPortletContext for the specified portlet window
+     *
+     * @param portletWindow portlet window
+     * @return portlet context or null if not registered
+     */
+    InternalPortletContext getPortletContext(PortletWindow portletWindow)
+        throws PortletContainerException;
+
+    /**
+     * Retrieve the portlet configuration for the specified portlet
+     * @param applicationName portlet application name
+     * @param portletName portlet name
+     * @return portletconfig
+     * @throws PortletContainerException if portlet or application unknown
+     */
+    InternalPortletConfig getPortletConfig(String applicationName, String portletName)
+        throws PortletContainerException;
+
+    /**
+     * Retrieve the ClassLoader of the specified portlet application
+     * @param applicationName portlet application name
+     * @return classLoader
+     */
+    ClassLoader getClassLoader(String applicationName)
+        throws PortletContainerException;
+    
+    /**
+     * Register a portlet application
+     * 
+     * @param config
+     * @return
+     * @throws PortletContainerException
+     */
+    String register(ServletConfig config) throws PortletContainerException;
+    
+    /**
+     * Unregister a portlet application
+     * 
+     * @param context
+     */
+    void unregister(InternalPortletContext context);
+}

Propchange: portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletContextService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletContextService.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletContextService.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletInvokerService.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletInvokerService.java?rev=709608&r1=709607&r2=709608&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletInvokerService.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletInvokerService.java Fri Oct 31 16:59:59 2008
@@ -29,8 +29,8 @@
 import javax.portlet.RenderResponse;
 import javax.portlet.ResourceRequest;
 import javax.portlet.ResourceResponse;
-import javax.servlet.ServletContext;
 
+import org.apache.pluto.PortletContainerException;
 import org.apache.pluto.PortletWindow;
 import org.apache.pluto.spi.FilterManager;
 
@@ -39,21 +39,21 @@
  */
 public interface PortletInvokerService {
 	
-    public void action(ServletContext servletContext, ActionRequest req, ActionResponse res, PortletWindow window, FilterManager filterManager)
-    	throws IOException, PortletException;
+    public void action(ActionRequest req, ActionResponse res, PortletWindow window, FilterManager filterManager)
+    	throws IOException, PortletException, PortletContainerException;
     
-    public void event(ServletContext servletContext, EventRequest request, EventResponse response, PortletWindow window, FilterManager filterManager)
-		throws IOException, PortletException;
+    public void event(EventRequest request, EventResponse response, PortletWindow window, FilterManager filterManager)
+        throws IOException, PortletException, PortletContainerException;
 
-    public void render(ServletContext servletContext, RenderRequest req, RenderResponse res, PortletWindow window, FilterManager filterManager)
-    	throws IOException, PortletException;
+    public void render(RenderRequest req, RenderResponse res, PortletWindow window, FilterManager filterManager)
+        throws IOException, PortletException, PortletContainerException;
     
-    public void serveResource(ServletContext servletContext, ResourceRequest req, ResourceResponse res, PortletWindow window, FilterManager filterManager)
-		throws IOException, PortletException;
+    public void serveResource(ResourceRequest req, ResourceResponse res, PortletWindow window, FilterManager filterManager)
+        throws IOException, PortletException, PortletContainerException;
 
-    public void load(ServletContext servletContext, PortletRequest req, PortletResponse res, PortletWindow window)
-    	throws IOException, PortletException;
+    public void load(PortletRequest req, PortletResponse res, PortletWindow window)
+        throws IOException, PortletException, PortletContainerException;
     
-    public void admin(ServletContext servletContext, PortletRequest req, PortletResponse res, PortletWindow window)
-    	throws IOException, PortletException;
+    public void admin(PortletRequest req, PortletResponse res, PortletWindow window)
+        throws IOException, PortletException, PortletContainerException;
 }

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletRegistryService.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletRegistryService.java?rev=709608&r1=709607&r2=709608&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletRegistryService.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/optional/PortletRegistryService.java Fri Oct 31 16:59:59 2008
@@ -19,11 +19,7 @@
 
 import java.util.Iterator;
 
-import javax.servlet.ServletConfig;
-
 import org.apache.pluto.PortletContainerException;
-import org.apache.pluto.internal.InternalPortletConfig;
-import org.apache.pluto.internal.InternalPortletContext;
 import org.apache.pluto.om.portlet.PortletDefinition;
 import org.apache.pluto.om.portlet.PortletApplicationDefinition;
 
@@ -38,17 +34,6 @@
  */
 public interface PortletRegistryService 
 {
-
-    /**
-     * Retrieve all registered applications.  This list
-     * will only contain those applications which have
-     * been registered with the container.  Others may
-     * or may not be available within the servers.
-     *
-     * @return iterator of all application descriptors.
-     */
-    Iterator<InternalPortletContext> getPortletContexts();
-
     /**
      * Retrieve the names of all registered applications.
      * This list will only contain those applications
@@ -73,15 +58,6 @@
         throws PortletContainerException;
 
     /**
-     * Retrieve the InternalPortletContext for the specified portlet application name
-     *
-     * @param applicationName portlet application name
-     * @return portlet context or null if not registered
-     */
-    InternalPortletContext getPortletContext(String applicationName)
-        throws PortletContainerException;
-
-    /**
      * Retreive the Portlet for the specified portlet.
      *
      * @param applicationName portlet application name
@@ -93,24 +69,6 @@
         throws PortletContainerException;
 
     /**
-     * Retrieve the portlet configuration for the specified portlet
-     * @param applicationName portlet application name
-     * @param portletName portlet name
-     * @return portletconfig
-     * @throws PortletContainerException if portlet or application unknown
-     */
-    InternalPortletConfig getPortletConfig(String applicationName, String portletName)
-        throws PortletContainerException;
-
-    /**
-     * Retrieve the ClassLoader of the specified portlet application
-     * @param applicationName portlet application name
-     * @return classLoader
-     */
-    ClassLoader getClassLoader(String applicationName)
-        throws PortletContainerException;
-    
-    /**
      * Add a listener which will recieve notifications of newly
      * registered applications.
      *
@@ -125,19 +83,4 @@
      */
     void removePortletRegistryListener(PortletRegistryListener listener);
     
-    /**
-     * Register a portlet application
-     * 
-     * @param config
-     * @return
-     * @throws PortletContainerException
-     */
-    String register(ServletConfig config) throws PortletContainerException;
-    
-    /**
-     * Unregister a portlet application
-     * 
-     * @param context
-     */
-    void unregister(InternalPortletContext context);
 }
\ No newline at end of file

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/DefaultOptionalContainerServices.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/DefaultOptionalContainerServices.java?rev=709608&r1=709607&r2=709608&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/DefaultOptionalContainerServices.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/DefaultOptionalContainerServices.java Fri Oct 31 16:59:59 2008
@@ -21,6 +21,7 @@
 import org.apache.pluto.descriptors.services.jaxb.PortletAppDescriptorServiceImpl;
 import org.apache.pluto.services.PortletAppDescriptorService;
 import org.apache.pluto.spi.optional.PortalAdministrationService;
+import org.apache.pluto.spi.optional.PortletContextService;
 import org.apache.pluto.spi.optional.PortletEnvironmentService;
 import org.apache.pluto.spi.optional.PortletInfoService;
 import org.apache.pluto.spi.optional.PortletInvokerService;
@@ -39,6 +40,7 @@
 
     private PortletPreferencesService portletPreferencesService;
     private PortletRegistryService portletRegistryService;
+    private PortletContextService portletContextService;
     private PortletInvokerService portletInvokerService;
     private PortletEnvironmentService portletEnvironmentService;
     private PortletInfoService portletInfoService;
@@ -55,7 +57,8 @@
     public DefaultOptionalContainerServices() {
         portletPreferencesService = new DefaultPortletPreferencesService();
         portletRegistryService = new PortletContextManager();
-        portletInvokerService = new DefaultPortletInvokerService();
+        portletContextService = (PortletContextManager)portletRegistryService;
+        portletInvokerService = new DefaultPortletInvokerService(portletContextService);
         portletEnvironmentService = new DefaultPortletEnvironmentService();
         portletInfoService = new DefaultPortletInfoService();
         portalAdministrationService = new DefaultPortalAdministrationService();
@@ -81,6 +84,10 @@
             portletRegistryService = root.getPortletRegistryService();
         }
 
+        if (root.getPortletContextService() != null) {
+            portletContextService = root.getPortletContextService();
+        }
+
         if(root.getPortletEnvironmentService() != null) {
             portletEnvironmentService = root.getPortletEnvironmentService();
         }
@@ -131,6 +138,10 @@
         return portletRegistryService;
     }
 
+    public PortletContextService getPortletContextService() {
+        return portletContextService;
+    }
+
     public PortletEnvironmentService getPortletEnvironmentService() {
         return portletEnvironmentService;
     }

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/DefaultPortletInvokerService.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/DefaultPortletInvokerService.java?rev=709608&r1=709607&r2=709608&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/DefaultPortletInvokerService.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/DefaultPortletInvokerService.java Fri Oct 31 16:59:59 2008
@@ -38,11 +38,13 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.pluto.Constants;
+import org.apache.pluto.PortletContainerException;
 import org.apache.pluto.PortletWindow;
 import org.apache.pluto.core.PortletServlet;
 import org.apache.pluto.internal.impl.PortletRequestImpl;
 import org.apache.pluto.internal.impl.PortletResponseImpl;
 import org.apache.pluto.spi.FilterManager;
+import org.apache.pluto.spi.optional.PortletContextService;
 import org.apache.pluto.spi.optional.PortletInvokerService;
 import org.apache.pluto.util.StringManager;
 
@@ -71,13 +73,16 @@
      * */
     private static final String PREFIX = "/PlutoInvoker/";
     
+    private PortletContextService portletContextService;
+    
     // Constructor -------------------------------------------------------------
 
     /**
      * Default Constructor.  Create a new invoker which
      * is initialized for the given <code>PortletWindow</code>.
      */
-    public DefaultPortletInvokerService() {
+    public DefaultPortletInvokerService(PortletContextService portletContextService) {
+        this.portletContextService = portletContextService;
     }
 
     // Public Methods ----------------------------------------------------------
@@ -90,12 +95,12 @@
      * @see PortletServlet
      * @see javax.portlet.Portlet#processAction(javax.portlet.ActionRequest,javax.portlet.ActionResponse)
      */
-    public void action(ServletContext servletContext, ActionRequest request, ActionResponse response, PortletWindow window, FilterManager filterManager)
-        throws IOException, PortletException {
+    public void action(ActionRequest request, ActionResponse response, PortletWindow window, FilterManager filterManager)
+        throws IOException, PortletException, PortletContainerException {
         if (LOG.isDebugEnabled()) {
             LOG.debug("Performing Action Invocation");
         }
-        invoke(servletContext, request, response, window, filterManager, Constants.METHOD_ACTION);
+        invoke(request, response, window, filterManager, Constants.METHOD_ACTION);
     }
 
     /**
@@ -106,12 +111,12 @@
      * @see PortletServlet
      * @see javax.portlet.Portlet#render(javax.portlet.RenderRequest,javax.portlet.RenderResponse)
      */
-    public void render(ServletContext servletContext, RenderRequest request, RenderResponse response, PortletWindow window, FilterManager filterManager)
-        throws IOException, PortletException {
+    public void render(RenderRequest request, RenderResponse response, PortletWindow window, FilterManager filterManager)
+        throws IOException, PortletException, PortletContainerException {
         if (LOG.isDebugEnabled()) {
             LOG.debug("Performing Render Invocation");
         }
-        invoke(servletContext, request, response, window, filterManager, Constants.METHOD_RENDER);
+        invoke(request, response, window, filterManager, Constants.METHOD_RENDER);
     }
     
     /**
@@ -122,12 +127,12 @@
      * @see PortletServlet
      * @see javax.portlet.Portlet#render(javax.portlet.RenderRequest,javax.portlet.RenderResponse)
      */
-    public void event(ServletContext servletContext, EventRequest request, EventResponse response, PortletWindow window, FilterManager filterManager)
-        throws IOException, PortletException {
+    public void event(EventRequest request, EventResponse response, PortletWindow window, FilterManager filterManager)
+        throws IOException, PortletException, PortletContainerException {
         if (LOG.isDebugEnabled()) {
             LOG.debug("Performing Render Invocation");
         }
-        invoke(servletContext, (PortletRequest)request, (PortletResponse)response, window, filterManager, Constants.METHOD_EVENT);
+        invoke((PortletRequest)request, (PortletResponse)response, window, filterManager, Constants.METHOD_EVENT);
     }
     
     /**
@@ -138,12 +143,12 @@
      * @see PortletServlet
      * @see javax.portlet.Portlet#resource(javax.portlet.ResourceRequest,javax.portlet.ResourceResponse)
      */
-    public void serveResource(ServletContext servletContext, ResourceRequest request, ResourceResponse response, PortletWindow window, FilterManager filterManager)
-        throws IOException, PortletException {
+    public void serveResource(ResourceRequest request, ResourceResponse response, PortletWindow window, FilterManager filterManager)
+        throws IOException, PortletException, PortletContainerException {
         if (LOG.isDebugEnabled()) {
             LOG.debug("Performing Resource Invocation");
         }
-        invoke(servletContext, request, response, window, filterManager, Constants.METHOD_RESOURCE);
+        invoke(request, response, window, filterManager, Constants.METHOD_RESOURCE);
     }
 
     /**
@@ -153,32 +158,32 @@
      * @param response action response used for the invocation.
      * @see PortletServlet
      */
-    public void load(ServletContext servletContext, PortletRequest request, PortletResponse response, PortletWindow window)
-        throws IOException, PortletException {
+    public void load(PortletRequest request, PortletResponse response, PortletWindow window)
+        throws IOException, PortletException, PortletContainerException {
         if (LOG.isDebugEnabled()) {
             LOG.debug("Performing Load Invocation.");
         }
-        invoke(servletContext, request, response, window, Constants.METHOD_NOOP);
+        invoke(request, response, window, Constants.METHOD_NOOP);
     }
 
-    public void admin(ServletContext servletContext, PortletRequest request, PortletResponse response, PortletWindow window)
-        throws IOException, PortletException {
+    public void admin(PortletRequest request, PortletResponse response, PortletWindow window)
+        throws IOException, PortletException, PortletContainerException {
         if (LOG.isDebugEnabled()) {
             LOG.debug("Performing Admin Invocation.");
         }
 
-        invoke(servletContext, request, response, window, Constants.METHOD_ADMIN);
+        invoke(request, response, window, Constants.METHOD_ADMIN);
     }
 
     // Private Invoke Method ---------------------------------------------------
 
-    private final void invoke(ServletContext servletContext, PortletRequest request,
+    private final void invoke(PortletRequest request,
                                 PortletResponse response,
                                 PortletWindow portletWindow,
                                 Integer methodID)
-    	throws PortletException, IOException{
+    	throws PortletException, IOException, PortletContainerException {
     	
-    	invoke(servletContext, request, response, portletWindow, null, methodID);
+    	invoke(request, response, portletWindow, null, methodID);
     }
     
     /**
@@ -191,13 +196,16 @@
      * @throws PortletException if a portlet exception occurs.
      * @throws IOException      if an error occurs writing to the response.
      */
-    protected final void invoke(ServletContext servletContext, PortletRequest request,
+    protected final void invoke(PortletRequest request,
                                 PortletResponse response,
                                 PortletWindow portletWindow,
                                 FilterManager filterManager,
                                 Integer methodID)
-        throws PortletException, IOException {
+        throws PortletException, IOException, PortletContainerException {
 
+        String appName = portletWindow.getPortletEntity().getPortletDefinition().getApplication().getName();
+        ServletContext servletContext = portletContextService.getPortletContext(appName).getServletContext();
+        
         String uri =  PREFIX + portletWindow.getPortletEntity().getPortletDefinition().getPortletName();
         if (LOG.isDebugEnabled()) {
             LOG.debug("Dispatching to portlet servlet at: " + uri);

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PlutoContainerServices.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PlutoContainerServices.java?rev=709608&r1=709607&r2=709608&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PlutoContainerServices.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PlutoContainerServices.java Fri Oct 31 16:59:59 2008
@@ -26,6 +26,7 @@
 import org.apache.pluto.spi.ContainerInvocationService;
 import org.apache.pluto.spi.PortalCallbackService;
 import org.apache.pluto.spi.optional.PortalAdministrationService;
+import org.apache.pluto.spi.optional.PortletContextService;
 import org.apache.pluto.spi.optional.PortletEnvironmentService;
 import org.apache.pluto.spi.optional.PortletInfoService;
 import org.apache.pluto.spi.optional.PortletInvokerService;
@@ -50,6 +51,7 @@
      */
     private PortletPreferencesService portletPreferencesService;
     private PortletRegistryService portletRegistryService;
+    private PortletContextService portletContextService;
     private PortletInvokerService portletInvokerService;
     private PortletEnvironmentService portletEnvironmentService;
     private PortletInfoService portletInfoService;
@@ -97,9 +99,14 @@
         portletRegistryService = optionalServices.getPortletRegistryService();
         if (portletRegistryService == null)
             portletRegistryService = new PortletContextManager();
+        portletContextService = optionalServices.getPortletContextService();
+        if (portletContextService == null && portletRegistryService instanceof PortletContextService)
+        {
+            portletContextService = (PortletContextService)portletRegistryService;
+        }
         portletInvokerService = optionalServices.getPortletInvokerService();
         if (portletInvokerService == null)
-            portletInvokerService = new DefaultPortletInvokerService();
+            portletInvokerService = new DefaultPortletInvokerService(portletContextService);
         portletEnvironmentService = optionalServices.getPortletEnvironmentService();
         if (portletEnvironmentService == null)
             portletEnvironmentService = new DefaultPortletEnvironmentService();
@@ -124,8 +131,8 @@
     {
         portletPreferencesService = new DefaultPortletPreferencesService();
         portletRegistryService = new PortletContextManager();
-
-        portletInvokerService = new DefaultPortletInvokerService();
+        portletContextService = (PortletContextManager)portletRegistryService;
+        portletInvokerService = new DefaultPortletInvokerService(portletContextService);
         portletEnvironmentService = new DefaultPortletEnvironmentService();
         portletInfoService = new DefaultPortletInfoService();
         portalAdministrationService = new DefaultPortalAdministrationService();
@@ -182,6 +189,11 @@
         return this.portletRegistryService;
     }
 
+    public PortletContextService getPortletContextService() 
+    {
+        return this.portletContextService;
+    }
+
     public PortletEnvironmentService getPortletEnvironmentService() 
     {
         return this.portletEnvironmentService;

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletContainerImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletContainerImpl.java?rev=709608&r1=709607&r2=709608&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletContainerImpl.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletContainerImpl.java Fri Oct 31 16:59:59 2008
@@ -43,7 +43,6 @@
 import org.apache.pluto.RequiredContainerServices;
 import org.apache.pluto.internal.InternalActionRequest;
 import org.apache.pluto.internal.InternalActionResponse;
-import org.apache.pluto.internal.InternalPortletContext;
 import org.apache.pluto.internal.InternalPortletRequest;
 import org.apache.pluto.internal.InternalPortletResponse;
 import org.apache.pluto.internal.InternalRenderRequest;
@@ -170,16 +169,13 @@
         InternalRenderResponse renderResponse = getOptionalContainerServices().getPortletEnvironmentService()
             .createRenderResponse(this, request, response, portletWindow);
 
-        String appName = portletWindow.getPortletEntity().getPortletDefinition().getApplication().getName();
-        InternalPortletContext portletContext = optionalContainerServices.getPortletRegistryService().getPortletContext(appName);
-        
         PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
 
         try {
             getInvocationService().setInvocation(this, portletWindow);
             //Filter initialisation
             FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.RENDER_PHASE);
-            invoker.render(portletContext.getServletContext(), renderRequest, renderResponse, portletWindow, filterManager);
+            invoker.render(renderRequest, renderResponse, portletWindow, filterManager);
         } finally {
             getInvocationService().clearInvocation();
         }
@@ -215,15 +211,12 @@
         InternalResourceResponse resourceResponse = getOptionalContainerServices().getPortletEnvironmentService()
             .createResourceResponse(this, request, response, portletWindow);
 
-        String appName = portletWindow.getPortletEntity().getPortletDefinition().getApplication().getName();
-        InternalPortletContext portletContext = optionalContainerServices.getPortletRegistryService().getPortletContext(appName);
-        
         PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
 
         try {
             getInvocationService().setInvocation(this, portletWindow);
             FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.RESOURCE_PHASE);
-            invoker.serveResource(portletContext.getServletContext(), resourceRequest, resourceResponse, portletWindow, filterManager);
+            invoker.serveResource(resourceRequest, resourceResponse, portletWindow, filterManager);
         } finally {
             getInvocationService().clearInvocation();
         }
@@ -259,15 +252,12 @@
         InternalActionResponse actionResponse = getOptionalContainerServices().getPortletEnvironmentService()
             .createActionResponse(this, request, response, portletWindow);
 
-        String appName = portletWindow.getPortletEntity().getPortletDefinition().getApplication().getName();
-        InternalPortletContext portletContext = optionalContainerServices.getPortletRegistryService().getPortletContext(appName);
-
         PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
 
         try {
             getInvocationService().setInvocation(this, portletWindow);
             FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.ACTION_PHASE);
-            invoker.action(portletContext.getServletContext(), actionRequest, actionResponse, portletWindow, filterManager);
+            invoker.action(actionRequest, actionResponse, portletWindow, filterManager);
         }
         finally {
             getInvocationService().clearInvocation();
@@ -342,14 +332,11 @@
             getOptionalContainerServices().getPortletEnvironmentService()
                 .createRenderResponse(this, request, response, portletWindow);
 
-        String appName = portletWindow.getPortletEntity().getPortletDefinition().getApplication().getName();
-        InternalPortletContext portletContext = optionalContainerServices.getPortletRegistryService().getPortletContext(appName);
-
         PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
 
         try {
             getInvocationService().setInvocation(this, portletWindow);
-            invoker.load(portletContext.getServletContext(), renderRequest, renderResponse, portletWindow);
+            invoker.load(renderRequest, renderResponse, portletWindow);
         } finally {
             getInvocationService().clearInvocation();
         }
@@ -373,14 +360,11 @@
         InternalPortletResponse internalResponse =
             new AdminResponse(this, portletWindow, servletRequest, servletResponse);
 
-        String appName = portletWindow.getPortletEntity().getPortletDefinition().getApplication().getName();
-        InternalPortletContext portletContext = optionalContainerServices.getPortletRegistryService().getPortletContext(appName);
-        
         PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
 
         try {
             getInvocationService().setInvocation(this, portletWindow);
-            invoker.admin(portletContext.getServletContext(), internalRequest, internalResponse, portletWindow);
+            invoker.admin(internalRequest, internalResponse, portletWindow);
         } finally {
             getInvocationService().clearInvocation();
         }
@@ -434,16 +418,12 @@
     	EventResponseImpl eventResponse = new EventResponseImpl(
     			this, window, request, response);
 
-    	
-        String appName = window.getPortletEntity().getPortletDefinition().getApplication().getName();
-        InternalPortletContext portletContext = optionalContainerServices.getPortletRegistryService().getPortletContext(appName);
-
     	PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
 
         try {
             getInvocationService().setInvocation(this, window);
             FilterManager filterManager = filterInitialisation(window,PortletRequest.EVENT_PHASE);
-            invoker.event(portletContext.getServletContext(), eventRequest, eventResponse, window, filterManager);
+            invoker.event(eventRequest, eventResponse, window, filterManager);
         }
         finally {
             getInvocationService().clearInvocation();

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java?rev=709608&r1=709607&r2=709608&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java Fri Oct 31 16:59:59 2008
@@ -31,6 +31,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.pluto.PortletContainerException;
+import org.apache.pluto.PortletWindow;
 import org.apache.pluto.internal.InternalPortletConfig;
 import org.apache.pluto.internal.InternalPortletContext;
 import org.apache.pluto.internal.impl.Configuration;
@@ -38,6 +39,7 @@
 import org.apache.pluto.internal.impl.PortletContextImpl;
 import org.apache.pluto.om.portlet.PortletDefinition;
 import org.apache.pluto.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.spi.optional.PortletContextService;
 import org.apache.pluto.spi.optional.PortletRegistryEvent;
 import org.apache.pluto.spi.optional.PortletRegistryListener;
 import org.apache.pluto.spi.optional.PortletRegistryService;
@@ -50,7 +52,7 @@
  * @version 1.0
  * @since Sep 20, 2004
  */
-public class PortletContextManager implements PortletRegistryService {
+public class PortletContextManager implements PortletRegistryService, PortletContextService {
 
 	/**
      * Log Instance
@@ -133,7 +135,7 @@
                 for (PortletDefinition portlet: portletApp.getPortlets()) {
                     portletConfigs.put(
                         portletContext.getApplicationName() + "/" + portlet.getPortletName(),
-                        new PortletConfigImpl(config, portletContext, portlet, portletApp)
+                        new PortletConfigImpl(portletContext, portlet, portletApp)
                     );
                 }
             }
@@ -173,6 +175,15 @@
     public InternalPortletContext getPortletContext(String applicationName) {
         return portletContexts.get(applicationName);
     }
+    
+    /* (non-Javadoc)
+     * @see org.apache.pluto.services.PortletContextService#getPortletContext(org.apache.pluto.PortletWindow)
+     */
+    public InternalPortletContext getPortletContext(PortletWindow portletWindow) throws PortletContainerException
+    {
+        return portletContexts.get(portletWindow.getPortletEntity().getPortletDefinition().getApplication().getName());
+    }
+
 
     public InternalPortletConfig getPortletConfig(String applicationName, String portletName) throws PortletContainerException {
         InternalPortletConfig ipc = portletConfigs.get(applicationName + "/" + portletName);

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletConfigImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletConfigImpl.java?rev=709608&r1=709607&r2=709608&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletConfigImpl.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletConfigImpl.java Fri Oct 31 16:59:59 2008
@@ -28,7 +28,6 @@
 
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletContext;
-import javax.servlet.ServletConfig;
 import javax.xml.XMLConstants;
 import javax.xml.namespace.QName;
 
@@ -46,11 +45,6 @@
     private static final Log LOG = LogFactory.getLog(PortletConfigImpl.class);
 
     /**
-     * The servlet config for which we exist.
-     */
-    protected ServletConfig servletConfig;
-
-    /**
      * The Portlet Application Context within which we exist.
      */
     protected PortletContext portletContext;
@@ -67,11 +61,9 @@
 
     protected ResourceBundleFactory bundles;
 
-    public PortletConfigImpl(ServletConfig servletConfig,
-                             PortletContext portletContext,
+    public PortletConfigImpl(PortletContext portletContext,
                              PortletDefinition portletDD,
                              PortletApplicationDefinition portletAppDD) {
-        this.servletConfig = servletConfig;
         this.portletContext = portletContext;
         this.portlet = portletDD;
         this.portletApp = portletAppDD;
@@ -128,11 +120,6 @@
         };
     }
 
-
-    public javax.servlet.ServletConfig getServletConfig() {
-        return servletConfig;
-    }
-
     public PortletDefinition getPortletDefinition() {
         return portlet;
     }

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventProviderImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventProviderImpl.java?rev=709608&r1=709607&r2=709608&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventProviderImpl.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventProviderImpl.java Fri Oct 31 16:59:59 2008
@@ -58,6 +58,7 @@
 import org.apache.pluto.om.portlet.EventDefinitionReference;
 import org.apache.pluto.om.portlet.PortletDefinition;
 import org.apache.pluto.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.spi.optional.PortletContextService;
 import org.apache.pluto.spi.EventProvider;
 import org.apache.pluto.spi.optional.PortletRegistryService;
 
@@ -88,6 +89,9 @@
 	/** PortletRegistryService used to obtain PortletApplicationConfig objects */
 	private PortletRegistryService portletRegistry;
 
+	/** PortletContextService used to obtain PortletContext objects */
+    private PortletContextService portletContextService;
+
 	/**
 	 * factory method gets the EventProvider out of the Request, or sets a new
 	 * one
@@ -380,18 +384,16 @@
 	private PortletWindowThread getPortletWindowThread(
 			EventContainer eventContainer, PortletWindowConfig config,
 			PortletWindow window, ServletContext containerServletContext) {
-		if (portletRegistry == null) {
-			portletRegistry = ((PortletContainer) containerServletContext
-					.getAttribute(AttributeKeys.PORTLET_CONTAINER))
-					.getOptionalContainerServices().getPortletRegistryService();
+		if (portletContextService == null) {
+			portletContextService = container.getOptionalContainerServices().getPortletContextService();
 		}
-		if (portletRegistry != null){
+		if (portletContextService != null){
 			String windowID = window.getId().getStringId();
 			PortletWindowThread portletWindowThread = portletWindowThreads
 					.get(windowID);
 			if (portletWindowThread == null) {
 				portletWindowThread = new PortletWindowThread(threadGroup, config
-						.getId(), this, window, eventContainer,portletRegistry);
+						.getId(), this, window, eventContainer,portletContextService);
 				portletWindowThreads.put(windowID, portletWindowThread);
 			} else {
 				// a thread could be started twice, so we make a new one,
@@ -404,7 +406,7 @@
 				}
 				portletWindowThreads.remove(portletWindowThread);
 				portletWindowThread = new PortletWindowThread(threadGroup, config
-						.getId(), this, window, eventContainer,portletRegistry);
+						.getId(), this, window, eventContainer,portletContextService);
 				portletWindowThreads.put(windowID, portletWindowThread);
 			}
 			return portletWindowThread;

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletWindowThread.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletWindowThread.java?rev=709608&r1=709607&r2=709608&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletWindowThread.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/PortletWindowThread.java Fri Oct 31 16:59:59 2008
@@ -44,7 +44,7 @@
 import org.apache.pluto.internal.impl.EventImpl;
 import org.apache.pluto.om.portlet.EventDefinition;
 import org.apache.pluto.om.portlet.PortletApplicationDefinition;
-import org.apache.pluto.spi.optional.PortletRegistryService;
+import org.apache.pluto.spi.optional.PortletContextService;
 
 public class PortletWindowThread extends Thread {
 	
@@ -58,17 +58,17 @@
 	private EventContainer eventContainer;
 	
 	/** PortletRegistryService used to obtain PortletApplicationConfig objects */
-	private PortletRegistryService portletRegistry;
+	private PortletContextService portletContextService;
 	
 	private List<Event> events = new ArrayList<Event>();
 
 	public PortletWindowThread(ThreadGroup group, String name,
-			EventProviderImpl eventProvider, PortletWindow window, EventContainer eventContainer, PortletRegistryService portletRegistry) {
+			EventProviderImpl eventProvider, PortletWindow window, EventContainer eventContainer, PortletContextService portletContextService) {
 		super(group, name);
 		this.eventProvider = eventProvider;
 		this.portletWindow = window;
 		this.eventContainer = eventContainer;
-		this.portletRegistry = portletRegistry;
+		this.portletContextService = portletContextService;
 	}
 
 	/* (non-Javadoc)
@@ -106,7 +106,7 @@
 			        		// now test if object is jaxb
 			        		EventDefinition eventDefinitionDD = getEventDefintion(event.getQName()); 
 			        		
-			        		ClassLoader loader = portletRegistry.getClassLoader(portletWindow.getPortletEntity().getPortletDefinition().getApplication().getName());
+			        		ClassLoader loader = portletContextService.getClassLoader(portletWindow.getPortletEntity().getPortletDefinition().getApplication().getName());
 			        		Class<? extends Serializable> clazz = loader.loadClass(eventDefinitionDD.getValueType()).asSubclass(Serializable.class);
 
 			        		JAXBContext jc = JAXBContext.newInstance(clazz);

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java?rev=709608&r1=709607&r2=709608&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java Fri Oct 31 16:59:59 2008
@@ -37,6 +37,8 @@
 import org.apache.pluto.om.portlet.PortletDefinition;
 import org.apache.pluto.om.portlet.PortletApplicationDefinition;
 import org.apache.pluto.om.portlet.Supports;
+import org.apache.pluto.services.PlutoServices;
+import org.apache.pluto.spi.optional.PortletContextService;
 import org.apache.pluto.spi.optional.PortletRegistryService;
 
 /**
@@ -67,6 +69,8 @@
 
     /** The portal's servletContext **/
     private ServletContext servletContext;
+    
+    private PortletContextService portletContextService;
 
     /**
      * Constructs a SupportedModesService with its dependencies.
@@ -156,6 +160,7 @@
 
     public void init(ServletContext ctx) throws DriverConfigurationException {
         this.servletContext = ctx;
+        this.portletContextService = portletContextService = PlutoServices.getServices().getPortletContextService();
         loadPortalModes();
     }    
     
@@ -284,6 +289,6 @@
 	                    .getPortletRegistryService();
 	        }
 	        
-		return portletRegistry.getPortletConfig(applicationName, portletName);
+		return portletContextService.getPortletConfig(applicationName, portletName);
 	}
 }

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/view.jsp
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/view.jsp?rev=709608&r1=709607&r2=709608&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/view.jsp (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/view.jsp Fri Oct 31 16:59:59 2008
@@ -95,7 +95,7 @@
 
     <script type="text/javascript">
         var <portlet:namespace/>portlets = new Array();
-        <c:forEach items="${portletContainer.optionalContainerServices.portletRegistryService.portletContexts}" var="app">
+        <c:forEach items="${portletContainer.optionalContainerServices.portletContextService.portletContexts}" var="app">
             <portlet:namespace/>portlets['<c:out value="${app.applicationName}"/>'] = new Array();
             <portlet:namespace/>portlets['<c:out value="${app.applicationName}"/>'][0] = 'Select. . .';
           <c:forEach items="${app.portletApplicationDefinition.portlets}" var="portlet" varStatus="loopStatus">
@@ -128,7 +128,7 @@
 
     <select name="applications" onChange="<portlet:namespace/>doSwitch(this)">
       <option value='-'>Select. . .</option>
-      <c:forEach items="${portletContainer.optionalContainerServices.portletRegistryService.portletContexts}" var="app">
+      <c:forEach items="${portletContainer.optionalContainerServices.portletContextService.portletContexts}" var="app">
       <option value="<c:out value="${app.applicationName}"/>"><c:out value="${app.applicationName}"/></option>
       </c:forEach>
     </select>