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 ta...@apache.org on 2008/10/16 02:10:19 UTC

svn commit: r705103 - 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/services/ pluto-contai...

Author: taylor
Date: Wed Oct 15 17:10:18 2008
New Revision: 705103

URL: http://svn.apache.org/viewvc?rev=705103&view=rev
Log:
https://issues.apache.org/jira/browse/PLUTO-511

Added:
    portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/ContainerInvocation.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/core/   (with props)
    portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/core/NullPortlet.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/services/
    portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/services/ContainerServices.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/ContainerInvocationService.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/ContainerInvocationImpl.java   (contents, props changed)
      - copied, changed from r704745, portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/ContainerInvocation.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/ContainerInvocationServiceImpl.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PlutoContainerServices.java
Removed:
    portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/ContainerInvocation.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/NullPortlet.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PortletServlet.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/test/java/org/apache/pluto/core/ContainerInvocationTest.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/test/java/org/apache/pluto/core/PortletContextManagerTest.java
Modified:
    portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/RequiredContainerServices.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/pom.xml
    portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/PortletContainerFactory.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/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/ResourceBundleFactory.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/test/java/org/apache/pluto/internal/impl/PortletRequestImplTest.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/test/java/org/apache/pluto/internal/impl/ResourceBundleFactoryTest.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/test/java/org/apache/pluto/util/PlutoTestCase.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-impl/src/main/java/org/apache/pluto/descriptors/services/jaxb/PortletAppDescriptorServiceImpl.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationImpl.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/ContainerServicesImpl.java
    portals/pluto/branches/2.0-spi-refactoring/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-services-config.xml
    portals/pluto/branches/2.0-spi-refactoring/pluto-taglib/pom.xml
    portals/pluto/branches/2.0-spi-refactoring/pluto-taglib/src/main/java/org/apache/pluto/tags/el/ExpressionEvaluatorProxy.java

Added: portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/ContainerInvocation.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/ContainerInvocation.java?rev=705103&view=auto
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/ContainerInvocation.java (added)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/ContainerInvocation.java Wed Oct 15 17:10:18 2008
@@ -0,0 +1,25 @@
+/*
+ * 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;
+
+public interface ContainerInvocation
+{
+    PortletWindow getPortletWindow();
+    void setWindow(PortletWindow window);
+    PortletContainer getPortletContainer();
+    void setContainer(PortletContainer container);
+}

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/RequiredContainerServices.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/RequiredContainerServices.java?rev=705103&r1=705102&r2=705103&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/RequiredContainerServices.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/RequiredContainerServices.java Wed Oct 15 17:10:18 2008
@@ -19,6 +19,7 @@
 import javax.portlet.PortalContext;
 
 import org.apache.pluto.spi.CCPPProfileService;
+import org.apache.pluto.spi.ContainerInvocationService;
 import org.apache.pluto.spi.PortalCallbackService;
 
 /**
@@ -48,4 +49,5 @@
      */
     CCPPProfileService getCCPPProfileService();
     
+    ContainerInvocationService getContainerInvocationService();
 }

Propchange: portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/core/
------------------------------------------------------------------------------
    svn:mergeinfo = 

Added: portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/core/NullPortlet.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/core/NullPortlet.java?rev=705103&view=auto
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/core/NullPortlet.java (added)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/core/NullPortlet.java Wed Oct 15 17:10:18 2008
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.core;
+
+/**
+ * Implements the Null Object Pattern
+ * 
+ * @author <a href="mailto:chrisra@cs.uni-jena.de">Christian Raschka</a>
+ *
+ */
+
+import java.io.IOException;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.EventPortlet;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+import javax.portlet.ResourceServingPortlet;
+
+public class NullPortlet implements EventPortlet, ResourceServingPortlet,
+               Portlet {
+
+       public void processEvent(EventRequest arg0, EventResponse arg1)
+                       throws PortletException, IOException {
+
+       }
+
+       public void serveResource(ResourceRequest arg0, ResourceResponse arg1)
+                       throws PortletException, IOException {
+
+       }
+
+       public void destroy() {
+
+       }
+
+       public void init(PortletConfig arg0) throws PortletException {
+
+       }
+
+       public void processAction(ActionRequest arg0, ActionResponse arg1)
+                       throws PortletException, IOException {
+
+       }
+
+       public void render(RenderRequest arg0, RenderResponse arg1)
+                       throws PortletException, IOException {
+
+       }
+
+}

Added: 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=705103&view=auto
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/core/PortletServlet.java (added)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/core/PortletServlet.java Wed Oct 15 17:10:18 2008
@@ -0,0 +1,440 @@
+/*
+ * 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.core;
+
+import java.io.IOException;
+import java.util.Iterator;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.EventPortlet;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+import javax.portlet.ResourceServingPortlet;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.pluto.Constants;
+import org.apache.pluto.ContainerInvocation;
+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.InternalPortletRequest;
+import org.apache.pluto.internal.InternalPortletResponse;
+import org.apache.pluto.om.portlet.PortletDefinition;
+import org.apache.pluto.services.PlutoServices;
+import org.apache.pluto.spi.ContainerInvocationService;
+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.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
+ * the the container and services the portlet request for the specified method.
+ * 
+ * @version 1.1
+ * @since 09/22/2004
+ */
+public class PortletServlet extends HttpServlet
+{
+
+    // Private Member Variables ------------------------------------------------
+    /**
+     * The portlet name as defined in the portlet app descriptor.
+     */
+    private String portletName;
+
+    /**
+     * The portlet instance wrapped by this servlet.
+     */
+    private Portlet portlet;
+
+    /**
+     * The internal portlet context instance.
+     */
+    private InternalPortletContext portletContext;
+
+    /**
+     * The internal portlet config instance.
+     */
+    private InternalPortletConfig portletConfig;
+
+    /**
+     * The Event Portlet instance (the same object as portlet) wrapped by this
+     * servlet.
+     */
+    private EventPortlet eventPortlet = null;
+
+    /** The resource serving portlet instance wrapped by this servlet. */
+    private ResourceServingPortlet resourceServingPortlet = null;
+
+    private PortletRegistryService registryService;
+
+    private ContainerInvocationService containerInvocationService;
+
+    // HttpServlet Impl --------------------------------------------------------
+
+    public String getServletInfo()
+    {
+        return "Pluto PortletServlet [" + portletName + "]";
+    }
+
+    /**
+     * Initialize the portlet invocation servlet.
+     * 
+     * @throws ServletException
+     *             if an error occurs while loading portlet.
+     */
+    public void init() throws ServletException
+    {
+
+        // Call the super initialization method.
+        super.init();
+
+        // Retrieve portlet name as defined as an initialization parameter.
+        portletName = getInitParameter("portlet-name");
+
+        registryService = PlutoServices.getServices()
+                .getPortletRegistryService();
+        if (registryService == null) // TODO: wait for Pluto to come on line
+        { throw new ServletException(
+                "Pluto container has not yet come online, startup sequence error, registry service not available");
+
+        }
+        containerInvocationService = PlutoServices.getServices()
+                .getContainerInvocationService();
+        if (containerInvocationService == null) // TODO: wait for Pluto to come
+        // on line
+        { throw new ServletException(
+                "Pluto container has not yet come online, startup sequence error, container invocation service not available");
+
+        }
+        try
+        {
+            ServletConfig sConfig = getServletConfig();
+            if (sConfig == null)
+            {
+                String msg = "Problem obtaining servlet configuration(getServletConfig() returns null).";
+                throw new PortletContainerException(msg);
+            }
+
+            String applicationId = registryService.register(sConfig);
+            portletContext = (InternalPortletContext) registryService
+                    .getPortletContext(applicationId);
+            portletConfig = (InternalPortletConfig) registryService
+                    .getPortletConfig(applicationId, portletName);
+
+        }
+        catch (PortletContainerException ex)
+        {
+            System.err.println(ex.getMessage());
+            throw new ServletException(ex);
+        }
+
+        PortletDefinition portletDD = portletConfig.getPortletDefinition();
+
+        // Create and initialize the portlet wrapped in the servlet.
+        try
+        {
+            ClassLoader loader = Thread.currentThread().getContextClassLoader();
+            Class clazz = loader.loadClass((portletDD.getPortletClass()));
+            portlet = (Portlet) clazz.newInstance();
+            portlet.init(portletConfig);
+            initializeEventPortlet();
+            initializeResourceServingPortlet();
+        }
+        catch (ClassNotFoundException ex)
+        {
+            System.err.println(ex.getMessage());
+            throw new ServletException(ex);
+        }
+        catch (IllegalAccessException ex)
+        {
+            System.err.println(ex.getMessage());
+            throw new ServletException(ex);
+        }
+        catch (InstantiationException ex)
+        {
+            System.err.println(ex.getMessage());
+            throw new ServletException(ex);
+        }
+        catch (PortletException ex)
+        {
+            System.err.println(ex.getMessage());
+            throw new ServletException(ex);
+        }
+    }
+
+    public void destroy()
+    {
+        registryService.remove(portletContext);
+        if (portlet != null)
+        {
+            portlet.destroy();
+        }
+        super.destroy();
+    }
+
+    protected void doGet(HttpServletRequest request,
+            HttpServletResponse response) throws ServletException, IOException
+    {
+        dispatch(request, response);
+    }
+
+    protected void doPost(HttpServletRequest request,
+            HttpServletResponse response) throws ServletException, IOException
+    {
+        dispatch(request, response);
+    }
+
+    protected void doPut(HttpServletRequest request,
+            HttpServletResponse response) throws ServletException, IOException
+    {
+        dispatch(request, response);
+    }
+
+    // Private Methods ---------------------------------------------------------
+
+    /**
+     * Dispatch the request to the appropriate portlet methods. This method
+     * assumes that the following attributes are set in the servlet request
+     * scope:
+     * <ul>
+     * <li>METHOD_ID: indicating which method to dispatch.</li>
+     * <li>PORTLET_REQUEST: the internal portlet request.</li>
+     * <li>PORTLET_RESPONSE: the internal portlet response.</li>
+     * </ul>
+     * 
+     * @param request
+     *            the servlet request.
+     * @param response
+     *            the servlet response.
+     * @throws ServletException
+     * @throws IOException
+     */
+    private void dispatch(HttpServletRequest request,
+            HttpServletResponse response) throws ServletException, IOException
+    {
+        InternalPortletRequest portletRequest = null;
+        InternalPortletResponse portletResponse = null;
+        // Save portlet config into servlet request.
+
+        request.setAttribute(Constants.PORTLET_CONFIG, portletConfig);
+
+        // Retrieve attributes from the servlet request.
+        Integer methodId = (Integer) request.getAttribute(Constants.METHOD_ID);
+
+        portletRequest = (InternalPortletRequest) request
+                .getAttribute(Constants.PORTLET_REQUEST);
+
+        portletResponse = (InternalPortletResponse) request
+                .getAttribute(Constants.PORTLET_RESPONSE);
+
+        FilterManager filterManager = (FilterManager) request
+                .getAttribute(Constants.FILTER_MANAGER);
+
+        portletRequest.init(portletContext, request);
+
+        PortletWindow window = containerInvocationService.getInvocation()
+                .getPortletWindow();
+
+        PortletInvocationEvent event = new PortletInvocationEvent(
+                portletRequest, window, methodId.intValue());
+
+        notify(event, true, null);
+
+        // Init the classloader for the filter and get the Service for
+        // processing the filters.
+        ClassLoader loader = Thread.currentThread().getContextClassLoader();
+        // FilterManager filtermanager = (FilterManager) request.getAttribute(
+        // "filter-manager");
+
+        try
+        {
+
+            // The requested method is RENDER: call Portlet.render(..)
+            if (methodId == Constants.METHOD_RENDER)
+            {
+                RenderRequest renderRequest = (RenderRequest) portletRequest;
+                RenderResponse renderResponse = (RenderResponse) portletResponse;
+                filterManager.processFilter(renderRequest, renderResponse,
+                        loader, portlet, portletContext);
+            }
+
+            // The requested method is RESOURCE: call
+            // ResourceServingPortlet.serveResource(..)
+            else if (methodId == Constants.METHOD_RESOURCE)
+            {
+                ResourceRequest resourceRequest = (ResourceRequest) portletRequest;
+                ResourceResponse resourceResponse = (ResourceResponse) portletResponse;
+                filterManager.processFilter(resourceRequest, resourceResponse,
+                        loader, resourceServingPortlet, portletContext);
+            }
+
+            // The requested method is ACTION: call Portlet.processAction(..)
+            else if (methodId == Constants.METHOD_ACTION)
+            {
+                ActionRequest actionRequest = (ActionRequest) portletRequest;
+                ActionResponse actionResponse = (ActionResponse) portletResponse;
+                filterManager.processFilter(actionRequest, actionResponse,
+                        loader, portlet, portletContext);
+            }
+
+            // The request methode is Event: call Portlet.processEvent(..)
+            else if (methodId == Constants.METHOD_EVENT)
+            {
+                EventRequest eventRequest = (EventRequest) portletRequest;
+                EventResponse eventResponse = (EventResponse) portletResponse;
+                filterManager.processFilter(eventRequest, eventResponse,
+                        loader, eventPortlet, portletContext);
+            }
+            // The requested method is ADMIN: call handlers.
+            else if (methodId == Constants.METHOD_ADMIN)
+            {
+
+                ContainerInvocation inv = containerInvocationService
+                        .getInvocation();
+                PortalAdministrationService pas = inv.getPortletContainer()
+                        .getOptionalContainerServices()
+                        .getPortalAdministrationService();
+
+                Iterator it = pas.getAdministrativeRequestListeners()
+                        .iterator();
+                while (it.hasNext())
+                {
+                    AdministrativeRequestListener l = (AdministrativeRequestListener) it
+                            .next();
+                    l.administer(portletRequest, portletResponse);
+                }
+            }
+
+            // The requested method is NOOP: do nothing.
+            else if (methodId == Constants.METHOD_NOOP)
+            {
+                // Do nothing.
+            }
+
+            notify(event, false, null);
+
+        }
+        catch (javax.portlet.UnavailableException ex)
+        {
+            System.err.println(ex.getMessage());
+            /*
+             * if (e.isPermanent()) { throw new
+             * UnavailableException(e.getMessage()); } else { throw new
+             * UnavailableException(e.getMessage(), e.getUnavailableSeconds());
+             * }
+             */
+
+            // Portlet.destroy() isn't called by Tomcat, so we have to fix it.
+            try
+            {
+                portlet.destroy();
+            }
+            catch (Throwable th)
+            {
+                System.err.println(ex.getMessage());
+                // Don't care for Exception
+            }
+
+            // TODO: Handle everything as permanently for now.
+            throw new javax.servlet.UnavailableException(ex.getMessage());
+
+        }
+        catch (PortletException ex)
+        {
+            notify(event, false, ex);
+            System.err.println(ex.getMessage());
+            throw new ServletException(ex);
+
+        }
+        finally
+        {
+            request.removeAttribute(Constants.PORTLET_CONFIG);
+            if (portletRequest != null)
+            {
+                portletRequest.release();
+            }
+        }
+    }
+
+    protected void notify(PortletInvocationEvent event, boolean pre, Throwable e)
+    {
+        ContainerInvocation inv = containerInvocationService.getInvocation();
+        PortalAdministrationService pas = inv.getPortletContainer()
+                .getOptionalContainerServices()
+                .getPortalAdministrationService();
+
+        Iterator i = pas.getPortletInvocationListeners().iterator();
+        while (i.hasNext())
+        {
+            PortletInvocationListener listener = (PortletInvocationListener) i
+                    .next();
+            if (pre)
+            {
+                listener.onBegin(event);
+            }
+            else if (e == null)
+            {
+                listener.onEnd(event);
+            }
+            else
+            {
+                listener.onError(event, e);
+            }
+        }
+
+    }
+
+    private void initializeEventPortlet()
+    {
+        if (portlet instanceof EventPortlet)
+        {
+            eventPortlet = (EventPortlet) portlet;
+        }
+        else
+        {
+            eventPortlet = new NullPortlet();
+        }
+    }
+
+    private void initializeResourceServingPortlet()
+    {
+        if (portlet instanceof ResourceServingPortlet)
+        {
+            resourceServingPortlet = (ResourceServingPortlet) portlet;
+        }
+        else
+        {
+            resourceServingPortlet = new NullPortlet();
+        }
+    }
+}

Added: portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/services/ContainerServices.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/services/ContainerServices.java?rev=705103&view=auto
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/services/ContainerServices.java (added)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/services/ContainerServices.java Wed Oct 15 17:10:18 2008
@@ -0,0 +1,25 @@
+/*
+ * 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.services;
+
+import org.apache.pluto.OptionalContainerServices;
+import org.apache.pluto.RequiredContainerServices;
+
+
+public interface ContainerServices extends RequiredContainerServices, OptionalContainerServices
+{
+}

Added: 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=705103&view=auto
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/services/PlutoServices.java (added)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/services/PlutoServices.java Wed Oct 15 17:10:18 2008
@@ -0,0 +1,99 @@
+package org.apache.pluto.services;
+
+import javax.portlet.PortalContext;
+
+import org.apache.pluto.NamespaceMapper;
+import org.apache.pluto.spi.CCPPProfileService;
+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.PortletEnvironmentService;
+import org.apache.pluto.spi.optional.PortletInfoService;
+import org.apache.pluto.spi.optional.PortletInvokerService;
+import org.apache.pluto.spi.optional.PortletPreferencesService;
+import org.apache.pluto.spi.optional.PortletRegistryService;
+import org.apache.pluto.spi.optional.RequestAttributeService;
+import org.apache.pluto.spi.optional.UserInfoService;
+
+
+public class PlutoServices implements ContainerServices
+{
+    private ContainerServices provider;
+    private static PlutoServices singleton;
+
+    public static ContainerServices getServices()
+    {
+        return singleton;
+    }
+    
+    public PlutoServices(ContainerServices provider)
+    {
+        singleton = this;
+        this.provider = provider;
+    }
+    public CCPPProfileService getCCPPProfileService()
+    {
+        return provider.getCCPPProfileService();
+    }
+
+    public ContainerInvocationService getContainerInvocationService()
+    {
+        return provider.getContainerInvocationService();
+    }
+
+    public PortalCallbackService getPortalCallbackService()
+    {
+        return provider.getPortalCallbackService();
+    }
+
+    public PortalContext getPortalContext()
+    {
+        return provider.getPortalContext();
+    }
+
+    public NamespaceMapper getNamespaceMapper()
+    {
+        return provider.getNamespaceMapper();
+    }
+
+    public PortalAdministrationService getPortalAdministrationService()
+    {
+        return provider.getPortalAdministrationService();
+    }
+
+    public PortletEnvironmentService getPortletEnvironmentService()
+    {
+        return provider.getPortletEnvironmentService();
+    }
+
+    public PortletInfoService getPortletInfoService()
+    {
+        return provider.getPortletInfoService();
+    }
+
+    public PortletInvokerService getPortletInvokerService()
+    {
+        return provider.getPortletInvokerService();
+    }
+
+    public PortletPreferencesService getPortletPreferencesService()
+    {
+        return provider.getPortletPreferencesService();
+    }
+
+    public PortletRegistryService getPortletRegistryService()
+    {
+        return provider.getPortletRegistryService();
+    }
+
+    public RequestAttributeService getRequestAttributeService()
+    {
+        return provider.getRequestAttributeService();
+    }
+
+    public UserInfoService getUserInfoService()
+    {
+        return provider.getUserInfoService();
+    }
+
+}

Added: portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/ContainerInvocationService.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/ContainerInvocationService.java?rev=705103&view=auto
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/ContainerInvocationService.java (added)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container-api/src/main/java/org/apache/pluto/spi/ContainerInvocationService.java Wed Oct 15 17:10:18 2008
@@ -0,0 +1,29 @@
+/*
+ * 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;
+
+import org.apache.pluto.PortletContainer;
+import org.apache.pluto.PortletWindow;
+import org.apache.pluto.ContainerInvocation;
+
+
+public interface ContainerInvocationService
+{
+    ContainerInvocation getInvocation();
+    void setInvocation(PortletContainer container, PortletWindow window);
+    void clearInvocation();
+}

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=705103&r1=705102&r2=705103&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 Wed Oct 15 17:10:18 2008
@@ -19,6 +19,8 @@
 
 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;
@@ -34,7 +36,8 @@
  * @since 1.1.0
  *
  */
-public interface PortletRegistryService {
+public interface PortletRegistryService 
+{
 
     /**
      * Retrieve all registered applications.  This list
@@ -121,4 +124,8 @@
      * @param listener the listener to remove
      */
     void removePortletRegistryListener(PortletRegistryListener listener);
+    
+    String register(ServletConfig config) throws PortletContainerException;
+    
+    void remove(InternalPortletContext context);
 }
\ No newline at end of file

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container/pom.xml
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container/pom.xml?rev=705103&r1=705102&r2=705103&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container/pom.xml (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container/pom.xml Wed Oct 15 17:10:18 2008
@@ -34,18 +34,26 @@
   
   <dependencies>
 
-    <!-- Pluto Support Libraries =========================================== -->
     <dependency>
       <groupId>org.apache.pluto</groupId>
-      <artifactId>pluto-descriptor-api</artifactId>
+      <artifactId>pluto-container-api</artifactId>
       <version>${pom.version}</version>
       <scope>compile</scope>
     </dependency>
+
     <dependency>
-       <groupId>org.apache.pluto</groupId>
-       <artifactId>pluto-descriptor-impl</artifactId>
-       <version>${pom.version}</version>
-       <scope>runtime</scope>
+      <groupId>org.apache.pluto</groupId>
+      <artifactId>pluto-commons</artifactId>
+      <version>${pom.version}</version>
+      <scope>compile</scope>
+    </dependency>
+
+    <!-- Pluto Support Libraries ===========================================  -->
+    <dependency>
+      <groupId>org.apache.pluto</groupId>
+      <artifactId>pluto-descriptor-api</artifactId>
+      <version>${pom.version}</version>
+      <scope>compile</scope>
     </dependency>
 
     <!-- Other Support Libraries =========================================== -->
@@ -55,6 +63,7 @@
       <version>${commons-logging.version}</version>
       <scope>compile</scope>
     </dependency>
+<!-- 
 	<dependency>
 	  <groupId>stax</groupId>
 	  <artifactId>stax</artifactId>
@@ -65,7 +74,7 @@
 	  <artifactId>stax</artifactId>
 	  <version>${stax.impl.version}</version>
 	</dependency>
-    
+    -->
     <!-- Specification Libraries =========================================== -->
     <dependency>
       <groupId>javax.portlet</groupId>

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/PortletContainerFactory.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/PortletContainerFactory.java?rev=705103&r1=705102&r2=705103&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/PortletContainerFactory.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/PortletContainerFactory.java Wed Oct 15 17:10:18 2008
@@ -81,10 +81,8 @@
         ArgumentUtility.validateNotNull("requiredServices", requiredServices);
         ArgumentUtility.validateNotEmpty("containerName", containerName);
 
-        DefaultOptionalContainerServices optionalServicesWrapper =
-        		new DefaultOptionalContainerServices(optionalServices);
         PortletContainer container = new PortletContainerImpl(
-        		containerName, requiredServices, optionalServicesWrapper);
+        		containerName, requiredServices, optionalServices);
 
         if (LOG.isInfoEnabled()) {
             LOG.info("Portlet Container [" + containerName + "] created.");

Copied: portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/ContainerInvocationImpl.java (from r704745, portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/ContainerInvocation.java)
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/ContainerInvocationImpl.java?p2=portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/ContainerInvocationImpl.java&p1=portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/ContainerInvocation.java&r1=704745&r2=705103&rev=705103&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/ContainerInvocation.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/ContainerInvocationImpl.java Wed Oct 15 17:10:18 2008
@@ -17,6 +17,7 @@
  */
 package org.apache.pluto.core;
 
+import org.apache.pluto.ContainerInvocation;
 import org.apache.pluto.PortletContainer;
 import org.apache.pluto.PortletWindow;
 
@@ -35,40 +36,13 @@
  * @since 1.1
  *
  */
-public class ContainerInvocation {
-
-    private static final InheritableThreadLocal CONTAINERS =
-        new InheritableThreadLocal();
-
-    /**
-     * Retrieve the container which is currently
-     * executing.
-     *
-     * @return the currently executing portlet container.
-     */
-    public static ContainerInvocation getInvocation() {
-        return (ContainerInvocation)CONTAINERS.get();
-    }
-
-    /**
-     * Set the container currently under execution.
-     *
-     * @param container the container invoked
-     * @param window used in the invocation
-     */
-    public static void setInvocation(PortletContainer container, PortletWindow window) {
-        CONTAINERS.set(new ContainerInvocation(window, container));
-    }
-
-    public static void clearInvocation() {
-        CONTAINERS.set(null);
-    }
-
-
+public class ContainerInvocationImpl implements ContainerInvocation
+{
     private PortletWindow window;
     private PortletContainer container;
 
-    public ContainerInvocation(PortletWindow window, PortletContainer container) {
+    public ContainerInvocationImpl(PortletWindow window, PortletContainer container) 
+    {
         this.window = window;
         this.container = container;
     }

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

Propchange: portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/ContainerInvocationImpl.java
------------------------------------------------------------------------------
    svn:keywords = Id Author Date Rev

Propchange: portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/ContainerInvocationImpl.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Added: portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/ContainerInvocationServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/ContainerInvocationServiceImpl.java?rev=705103&view=auto
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/ContainerInvocationServiceImpl.java (added)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/ContainerInvocationServiceImpl.java Wed Oct 15 17:10:18 2008
@@ -0,0 +1,30 @@
+package org.apache.pluto.core;
+
+import org.apache.pluto.ContainerInvocation;
+import org.apache.pluto.PortletContainer;
+import org.apache.pluto.PortletWindow;
+import org.apache.pluto.spi.ContainerInvocationService;
+
+
+public class ContainerInvocationServiceImpl implements
+        ContainerInvocationService
+{
+    private final InheritableThreadLocal<ContainerInvocationImpl> CONTAINERS =
+        new InheritableThreadLocal<ContainerInvocationImpl>();
+
+    public void clearInvocation()
+    {
+        CONTAINERS.set(null);
+    }
+
+    public ContainerInvocation getInvocation()
+    {
+        return (ContainerInvocation)CONTAINERS.get();
+    }
+
+    public void setInvocation(PortletContainer container, PortletWindow window)
+    {
+        CONTAINERS.set(new ContainerInvocationImpl(window, container));
+    }
+
+}

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=705103&r1=705102&r2=705103&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 Wed Oct 15 17:10:18 2008
@@ -52,7 +52,7 @@
      */
     public DefaultOptionalContainerServices() {
         portletPreferencesService = new DefaultPortletPreferencesService();
-        portletRegistryService = PortletContextManager.getManager();
+        portletRegistryService = new PortletContextManager();
         portletInvokerService = new DefaultPortletInvokerService();
         portletEnvironmentService = new DefaultPortletEnvironmentService();
         portletInfoService = new DefaultPortletInfoService();

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=705103&r1=705102&r2=705103&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 Wed Oct 15 17:10:18 2008
@@ -39,6 +39,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.pluto.Constants;
 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;

Added: 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=705103&view=auto
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PlutoContainerServices.java (added)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/core/PlutoContainerServices.java Wed Oct 15 17:10:18 2008
@@ -0,0 +1,224 @@
+/*
+ * 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.core;
+
+import javax.portlet.PortalContext;
+
+import org.apache.pluto.NamespaceMapper;
+import org.apache.pluto.OptionalContainerServices;
+import org.apache.pluto.RequiredContainerServices;
+import org.apache.pluto.services.ContainerServices;
+import org.apache.pluto.spi.CCPPProfileService;
+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.PortletEnvironmentService;
+import org.apache.pluto.spi.optional.PortletInfoService;
+import org.apache.pluto.spi.optional.PortletInvokerService;
+import org.apache.pluto.spi.optional.PortletPreferencesService;
+import org.apache.pluto.spi.optional.PortletRegistryService;
+import org.apache.pluto.spi.optional.RequestAttributeService;
+import org.apache.pluto.spi.optional.UserInfoService;
+
+
+public class PlutoContainerServices implements ContainerServices
+{
+    /*
+     * required services
+     */
+    private PortalContext context;
+    private CCPPProfileService ccppProfileService;
+    private PortalCallbackService callbackService;
+    private ContainerInvocationService containerInvocation;
+    
+    /*
+     * optional services
+     */
+    private PortletPreferencesService portletPreferencesService;
+    private PortletRegistryService portletRegistryService;
+    private PortletInvokerService portletInvokerService;
+    private PortletEnvironmentService portletEnvironmentService;
+    private PortletInfoService portletInfoService;
+    private PortalAdministrationService portalAdministrationService;
+    private UserInfoService userInfoService;
+    private RequestAttributeService requestAttributeService;
+    private NamespaceMapper namespaceMapper;
+        
+    public PlutoContainerServices()
+    {
+        createDefaultRequiredServices();
+        createDefaultOptionalServices();
+    }
+    
+    public PlutoContainerServices(RequiredContainerServices required, OptionalContainerServices optional)
+    {
+        this(required.getPortalContext(), required.getCCPPProfileService(), required.getContainerInvocationService(), required.getPortalCallbackService(), optional);
+    }
+
+    public PlutoContainerServices(PortalContext context,
+            CCPPProfileService ccppProfileService,
+            ContainerInvocationService containerInvocation,
+            PortalCallbackService callbackService)
+    {
+        this.context = context;
+        this.ccppProfileService = ccppProfileService;
+        this.containerInvocation = containerInvocation;
+        this.callbackService = callbackService;
+        this.createDefaultOptionalServices();
+    }            
+            
+    public PlutoContainerServices(PortalContext context,
+            CCPPProfileService ccppProfileService,
+            ContainerInvocationService containerInvocation,
+            PortalCallbackService callbackService,            
+            OptionalContainerServices optionalServices)            
+    {
+        this.context = context;
+        this.ccppProfileService = ccppProfileService;
+        this.containerInvocation = containerInvocation;
+        
+        portletPreferencesService = optionalServices.getPortletPreferencesService();
+        if (portletPreferencesService == null)
+            portletPreferencesService =  new DefaultPortletPreferencesService();
+        portletRegistryService = optionalServices.getPortletRegistryService();
+        if (portletRegistryService == null)
+            portletRegistryService = new PortletContextManager();
+        portletInvokerService = optionalServices.getPortletInvokerService();
+        if (portletInvokerService == null)
+            portletInvokerService = new DefaultPortletInvokerService();
+        portletEnvironmentService = optionalServices.getPortletEnvironmentService();
+        if (portletEnvironmentService == null)
+            portletEnvironmentService = new DefaultPortletEnvironmentService();
+        portletInfoService = optionalServices.getPortletInfoService();
+        if (portletInfoService == null)
+            portletInfoService = new DefaultPortletInfoService();
+        portalAdministrationService = optionalServices.getPortalAdministrationService();
+        if (portalAdministrationService == null)
+            portalAdministrationService = new DefaultPortalAdministrationService();
+        userInfoService = optionalServices.getUserInfoService();
+        if (userInfoService == null)
+            userInfoService = new DefaultUserInfoService();
+        requestAttributeService = optionalServices.getRequestAttributeService();
+        if (requestAttributeService == null)
+            requestAttributeService = new DefaultRequestAttributeService(this);
+        namespaceMapper = optionalServices.getNamespaceMapper();
+        if (namespaceMapper == null)
+            namespaceMapper = new DefaultNamespaceMapper();        
+    }
+    
+    protected void createDefaultOptionalServices() 
+    {
+        portletPreferencesService = new DefaultPortletPreferencesService();
+        portletRegistryService = new PortletContextManager();
+
+        portletInvokerService = new DefaultPortletInvokerService();
+        portletEnvironmentService = new DefaultPortletEnvironmentService();
+        portletInfoService = new DefaultPortletInfoService();
+        portalAdministrationService = new DefaultPortalAdministrationService();
+        userInfoService = new DefaultUserInfoService();
+        requestAttributeService = new DefaultRequestAttributeService(this);
+        namespaceMapper = new DefaultNamespaceMapper();
+    }
+
+    protected void createDefaultRequiredServices() 
+    {
+        context = null; // TODO
+        ccppProfileService = new DummyCCPPProfileServiceImpl();
+        callbackService = null; // TODO
+        containerInvocation = new ContainerInvocationServiceImpl();        
+    }
+    
+    public PortalContext getPortalContext() 
+    {
+        return context;
+    }
+
+    public ContainerInvocationService getContainerInvocationService()
+    {
+        return containerInvocation;
+    }
+    
+    /**
+     * The PortletPreferencesService provides access to the portal's
+     * PortletPreference persistence mechanism.
+     * @return a PortletPreferencesService instance.
+     */
+    public PortletPreferencesService getPortletPreferencesService() 
+    {
+        return this.portletPreferencesService;
+    }
+
+    /**
+     * The PortalCallbackService allows the container to communicate
+     * actions back to the portal.
+     * @return a PortalCallbackService implementation.
+     */
+    public PortalCallbackService getPortalCallbackService() 
+    {
+        return callbackService;
+    }
+
+
+    /**
+     * Returns null to use pluto's default
+     * @return
+     */
+    public PortletRegistryService getPortletRegistryService() 
+    {
+        return this.portletRegistryService;
+    }
+
+    public PortletEnvironmentService getPortletEnvironmentService() 
+    {
+        return this.portletEnvironmentService;
+    }
+
+    public PortletInvokerService getPortletInvokerService() 
+    {
+        return this.portletInvokerService;
+    }
+
+    public CCPPProfileService getCCPPProfileService() 
+    {
+        return ccppProfileService;
+    }
+
+    public PortletInfoService getPortletInfoService() 
+    {
+        return this.portletInfoService;
+    }
+
+    public PortalAdministrationService getPortalAdministrationService() 
+    {
+        return this.portalAdministrationService;
+    }
+
+    public UserInfoService getUserInfoService() 
+    {
+        return this.userInfoService;
+    }
+    
+    public RequestAttributeService getRequestAttributeService() 
+    {
+        return this.requestAttributeService;
+    }
+    
+    public NamespaceMapper getNamespaceMapper() 
+    {
+        return this.namespaceMapper;
+    }
+}

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=705103&r1=705102&r2=705103&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 Wed Oct 15 17:10:18 2008
@@ -55,6 +55,7 @@
 import org.apache.pluto.internal.impl.PortletRequestImpl;
 import org.apache.pluto.internal.impl.PortletResponseImpl;
 import org.apache.pluto.internal.impl.StateAwareResponseImpl;
+import org.apache.pluto.spi.ContainerInvocationService;
 import org.apache.pluto.spi.EventProvider;
 import org.apache.pluto.spi.FilterManager;
 import org.apache.pluto.spi.PortletURLProvider;
@@ -89,6 +90,7 @@
     /** The optional container services associated with this container. */
     private final OptionalContainerServices optionalContainerServices;
     
+    
     /** Flag indicating whether or not we've been initialized. */
     private boolean initialized = false;
     
@@ -174,12 +176,12 @@
         PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
 
         try {
-            ContainerInvocation.setInvocation(this, portletWindow);
+            getInvocationService().setInvocation(this, portletWindow);
             //Filter initialisation
             FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.RENDER_PHASE);
             invoker.render(portletContext.getServletContext(), renderRequest, renderResponse, portletWindow, filterManager);
         } finally {
-            ContainerInvocation.clearInvocation();
+            getInvocationService().clearInvocation();
         }
         
         debugWithName("Portlet rendered for: "
@@ -219,11 +221,11 @@
         PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
 
         try {
-            ContainerInvocation.setInvocation(this, portletWindow);
+            getInvocationService().setInvocation(this, portletWindow);
             FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.RESOURCE_PHASE);
             invoker.serveResource(portletContext.getServletContext(), resourceRequest, resourceResponse, portletWindow, filterManager);
         } finally {
-            ContainerInvocation.clearInvocation();
+            getInvocationService().clearInvocation();
         }
         
         debugWithName("Portlet resource for: "
@@ -263,12 +265,12 @@
         PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
 
         try {
-            ContainerInvocation.setInvocation(this, portletWindow);
+            getInvocationService().setInvocation(this, portletWindow);
             FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.ACTION_PHASE);
             invoker.action(portletContext.getServletContext(), actionRequest, actionResponse, portletWindow, filterManager);
         }
         finally {
-            ContainerInvocation.clearInvocation();
+            getInvocationService().clearInvocation();
         }
 
         debugWithName("Portlet action processed for: "
@@ -340,10 +342,10 @@
         PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
 
         try {
-            ContainerInvocation.setInvocation(this, portletWindow);
+            getInvocationService().setInvocation(this, portletWindow);
             invoker.load(portletContext.getServletContext(), renderRequest, renderResponse, portletWindow);
         } finally {
-            ContainerInvocation.clearInvocation();
+            getInvocationService().clearInvocation();
         }
 
         debugWithName("Portlet loaded for: " + portletWindow.getPortletEntity().getPortletDefinition().getPortletName());
@@ -371,10 +373,10 @@
         PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
 
         try {
-            ContainerInvocation.setInvocation(this, portletWindow);
+            getInvocationService().setInvocation(this, portletWindow);
             invoker.admin(portletContext.getServletContext(), internalRequest, internalResponse, portletWindow);
         } finally {
-            ContainerInvocation.clearInvocation();
+            getInvocationService().clearInvocation();
         }
 
         debugWithName("Admin request complete.");
@@ -433,12 +435,12 @@
     	PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
 
         try {
-            ContainerInvocation.setInvocation(this, window);
+            getInvocationService().setInvocation(this, window);
             FilterManager filterManager = filterInitialisation(window,PortletRequest.EVENT_PHASE);
             invoker.event(portletContext.getServletContext(), eventRequest, eventResponse, window, filterManager);
         }
         finally {
-            ContainerInvocation.clearInvocation();
+            getInvocationService().clearInvocation();
         }
 
     	debugWithName("Portlet event processed for: "
@@ -462,6 +464,10 @@
     	}
     }
     
+    private ContainerInvocationService getInvocationService()
+    {
+        return requiredContainerServices.getContainerInvocationService();
+    }
     
     // Private Methods ---------------------------------------------------------
     

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=705103&r1=705102&r2=705103&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 Wed Oct 15 17:10:18 2008
@@ -56,11 +56,6 @@
      * Log Instance
      */
     private static final Log LOG = LogFactory.getLog(PortletContextManager.class);
-
-    /**
-     * The singleton manager instance.
-     */
-    private static final PortletContextManager MANAGER = new PortletContextManager();
     
     /**
      * The PortletContext cache map: key is servlet context, and value is the
@@ -99,17 +94,10 @@
     /**
      * Private constructor that prevents external instantiation.
      */
-    private PortletContextManager() {
+    public PortletContextManager() {
     	// Do nothing.
     }
 
-    /**
-     * Returns the singleton manager instance.
-     * @return the singleton manager instance.
-     */
-    public static PortletContextManager getManager() {
-        return MANAGER;
-    }
     
     // Public Methods ----------------------------------------------------------
 

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/ResourceBundleFactory.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/ResourceBundleFactory.java?rev=705103&r1=705102&r2=705103&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/ResourceBundleFactory.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/main/java/org/apache/pluto/internal/impl/ResourceBundleFactory.java Wed Oct 15 17:10:18 2008
@@ -24,10 +24,11 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.pluto.ContainerInvocation;
 import org.apache.pluto.PortletWindow;
-import org.apache.pluto.core.ContainerInvocation;
 import org.apache.pluto.om.portlet.PortletDefinition;
 import org.apache.pluto.om.portlet.PortletInfo;
+import org.apache.pluto.services.PlutoServices;
 import org.apache.pluto.spi.optional.PortletInfoService;
 import org.apache.pluto.util.StringManager;
 
@@ -119,16 +120,20 @@
     }
 
 
-    private PortletInfoService getPortletInfoService() {
-        ContainerInvocation invocation = ContainerInvocation.getInvocation();
+    private PortletInfoService getPortletInfoService() 
+    {
+        ContainerInvocation invocation = PlutoServices.getServices().getContainerInvocationService().getInvocation();
+        //ContainerInvocationImpl invocation = ContainerInvocationImpl.getInvocation();
         if(invocation != null) {
             return invocation.getPortletContainer().getOptionalContainerServices().getPortletInfoService();
         }
         return null;
     }
 
-    private PortletWindow getWindow() {
-        ContainerInvocation invocation = ContainerInvocation.getInvocation();
+    private PortletWindow getWindow() 
+    {
+        ContainerInvocation invocation = PlutoServices.getServices().getContainerInvocationService().getInvocation();
+//        ContainerInvocationImpl invocation = ContainerInvocationImpl.getInvocation();
         if(invocation != null) {
             return invocation.getPortletWindow();
         }

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/test/java/org/apache/pluto/internal/impl/PortletRequestImplTest.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/test/java/org/apache/pluto/internal/impl/PortletRequestImplTest.java?rev=705103&r1=705102&r2=705103&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/test/java/org/apache/pluto/internal/impl/PortletRequestImplTest.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/test/java/org/apache/pluto/internal/impl/PortletRequestImplTest.java Wed Oct 15 17:10:18 2008
@@ -52,7 +52,7 @@
     private Mock mockPortletContext = null;
     private Mock mockHttpServletRequest = null;
     private Mock mockRequestAttributeService = null;
-
+    
     private PortletWindow window = null;
 
     /* (non-Javadoc)
@@ -76,7 +76,7 @@
         mockRequestAttributeService = mock (RequestAttributeService.class);
 
         // Constructor expectations for RenderRequestImpl
-        mockContainer.expects( once() ).method( "getRequiredContainerServices" ).will( returnValue( mockServices.proxy() ) );
+        mockContainer.expects( atLeastOnce() ).method( "getRequiredContainerServices" ).will( returnValue( mockServices.proxy() ) );
         mockServices.expects( once() ).method( "getPortalContext" ).will( returnValue( mockPortalContext.proxy() ) );
     }
 

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/test/java/org/apache/pluto/internal/impl/ResourceBundleFactoryTest.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/test/java/org/apache/pluto/internal/impl/ResourceBundleFactoryTest.java?rev=705103&r1=705102&r2=705103&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/test/java/org/apache/pluto/internal/impl/ResourceBundleFactoryTest.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/test/java/org/apache/pluto/internal/impl/ResourceBundleFactoryTest.java Wed Oct 15 17:10:18 2008
@@ -23,7 +23,6 @@
 import junit.framework.Assert;
 
 import org.apache.pluto.descriptors.portlet20.PortletType;
-import org.apache.pluto.descriptors.portlet20.PortletInfoType;
 import org.apache.pluto.om.portlet.PortletDefinition;
 import org.apache.pluto.om.portlet.PortletInfo;
 import org.apache.pluto.util.PlutoTestCase;

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/test/java/org/apache/pluto/util/PlutoTestCase.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/test/java/org/apache/pluto/util/PlutoTestCase.java?rev=705103&r1=705102&r2=705103&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/test/java/org/apache/pluto/util/PlutoTestCase.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-container/src/test/java/org/apache/pluto/util/PlutoTestCase.java Wed Oct 15 17:10:18 2008
@@ -19,6 +19,9 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 
+import org.apache.pluto.core.PlutoContainerServices;
+import org.apache.pluto.services.ContainerServices;
+import org.apache.pluto.services.PlutoServices;
 import org.jmock.MockObjectTestCase;
 
 /**
@@ -32,6 +35,8 @@
     public void setUp() throws Exception {
         System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog");
         System.setProperty("org.apache.commons.logging.simplelog.defaultlog", "ERROR");
+        ContainerServices containerServices = new PlutoContainerServices();
+        new PlutoServices(containerServices);
     }
 
     protected void assertException(Object target, String methodName,

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-impl/src/main/java/org/apache/pluto/descriptors/services/jaxb/PortletAppDescriptorServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-impl/src/main/java/org/apache/pluto/descriptors/services/jaxb/PortletAppDescriptorServiceImpl.java?rev=705103&r1=705102&r2=705103&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-impl/src/main/java/org/apache/pluto/descriptors/services/jaxb/PortletAppDescriptorServiceImpl.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-impl/src/main/java/org/apache/pluto/descriptors/services/jaxb/PortletAppDescriptorServiceImpl.java Wed Oct 15 17:10:18 2008
@@ -33,7 +33,7 @@
     	try {
     		JAXBContext jc = JAXBContext.newInstance( 
     				"org.apache.pluto.descriptors.portlet10" + ":" +
-    				"org.apache.pluto.descriptors.portlet20");
+    				"org.apache.pluto.descriptors.portlet20", PortletAppDescriptorServiceImpl.class.getClassLoader());
 
     		Unmarshaller u = jc.createUnmarshaller();
     		u.setEventHandler(new javax.xml.bind.helpers.DefaultValidationEventHandler());

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationImpl.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/config/impl/DriverConfigurationImpl.java?rev=705103&r1=705102&r2=705103&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationImpl.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationImpl.java Wed Oct 15 17:10:18 2008
@@ -29,6 +29,7 @@
 import org.apache.pluto.driver.url.PortalURLParser;
 import org.apache.pluto.spi.PortalCallbackService;
 import org.apache.pluto.spi.optional.PortletPreferencesService;
+import org.apache.pluto.spi.optional.PortletRegistryService;
 
 /**
  * Encapsulation of the Pluto Driver ResourceConfig.
@@ -48,7 +49,8 @@
     // Container Services
     private PortalCallbackService portalCallbackService;
     private PortletPreferencesService portletPreferencesService;
-
+    private PortletRegistryService registryService;
+    
     public DriverConfigurationImpl(PortalURLParser portalUrlParser,
                                    PropertyConfigService propertyService,
                                    RenderConfigService renderService,
@@ -199,6 +201,16 @@
     	return renderService;
     }
 
+    public PortletRegistryService getPortletRegistryService()
+    {
+        return registryService;
+    }
+    
+    public void setPortletRegistryService(PortletRegistryService registryService)
+    {
+        this.registryService = registryService;
+    }
+    
     /**
      * Standard Getter.
      * @return the configuration data of all configured portlet applications.

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/ContainerServicesImpl.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/ContainerServicesImpl.java?rev=705103&r1=705102&r2=705103&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/ContainerServicesImpl.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/ContainerServicesImpl.java Wed Oct 15 17:10:18 2008
@@ -18,20 +18,14 @@
 
 import javax.portlet.PortalContext;
 
-import org.apache.pluto.NamespaceMapper;
 import org.apache.pluto.OptionalContainerServices;
 import org.apache.pluto.RequiredContainerServices;
+import org.apache.pluto.core.PlutoContainerServices;
 import org.apache.pluto.driver.config.DriverConfiguration;
 import org.apache.pluto.spi.CCPPProfileService;
+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.PortletEnvironmentService;
-import org.apache.pluto.spi.optional.PortletInfoService;
-import org.apache.pluto.spi.optional.PortletInvokerService;
 import org.apache.pluto.spi.optional.PortletPreferencesService;
-import org.apache.pluto.spi.optional.PortletRegistryService;
-import org.apache.pluto.spi.optional.RequestAttributeService;
-import org.apache.pluto.spi.optional.UserInfoService;
 
 /**
  * The Portal Driver's <code>PortletContainerServices</code> implementation. The
@@ -40,91 +34,42 @@
  * @version 1.0
  * @since Sep 21, 2004
  */
-public class ContainerServicesImpl
-implements RequiredContainerServices, OptionalContainerServices {
-
-
-    private PortalContextImpl context;
+public class ContainerServicesImpl extends PlutoContainerServices implements RequiredContainerServices, OptionalContainerServices 
+{
     private DriverConfiguration driverConfig;
-    private CCPPProfileService ccppProfileService;
-
 
     /**
      * Default Constructor.
      */
-    public ContainerServicesImpl(PortalContextImpl context,
+    public ContainerServicesImpl(PortalContext context,
                                  DriverConfiguration driverConfig,
-                                 CCPPProfileService ccppProfileService) {
-        this.context = context;
+                                 CCPPProfileService ccppProfileService,
+                                 ContainerInvocationService containerInvocation) 
+    {
+        super(context, ccppProfileService, containerInvocation, driverConfig.getPortalCallbackService());
         this.driverConfig = driverConfig;
-        this.ccppProfileService = ccppProfileService;
-    }
-
-    /**
-     * Standard Getter.
-     * @return the portal context for the portal which we service.
-     */
-    public PortalContext getPortalContext() {
-        return context;
     }
 
+    
     /**
      * The PortletPreferencesService provides access to the portal's
      * PortletPreference persistence mechanism.
      * @return a PortletPreferencesService instance.
      */
-    public PortletPreferencesService getPortletPreferencesService() {
-        return driverConfig.getPortletPreferencesService();
-    }
+//    public PortletPreferencesService getPortletPreferencesService() 
+//    {
+//        return driverConfig.getPortletPreferencesService();
+//    }
 
     /**
      * The PortalCallbackService allows the container to communicate
      * actions back to the portal.
      * @return a PortalCallbackService implementation.
      */
-    public PortalCallbackService getPortalCallbackService() {
+    public PortalCallbackService getPortalCallbackService() 
+    {
         return driverConfig.getPortalCallbackService();
     }
 
-
-    /**
-     * Returns null to use pluto's default
-     * @return
-     */
-    public PortletRegistryService getPortletRegistryService() {
-        return null;
-    }
-
-    public PortletEnvironmentService getPortletEnvironmentService() {
-        return null;
-    }
-
-    public PortletInvokerService getPortletInvokerService() {
-        return null;
-    }
-
-	public CCPPProfileService getCCPPProfileService() {
-		return ccppProfileService;
-	}
-
-    public PortletInfoService getPortletInfoService() {
-    	return null;
-   }
-
-    public PortalAdministrationService getPortalAdministrationService() {
-    	return null;
-    }
-
-    public UserInfoService getUserInfoService() {
-    	return null;
-    }
-    
-    public RequestAttributeService getRequestAttributeService() {
-        return null;
-    }
-    
-    public NamespaceMapper getNamespaceMapper() {
-        return null;
-    }
 }
 

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-services-config.xml
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-services-config.xml?rev=705103&r1=705102&r2=705103&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-services-config.xml (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-services-config.xml Wed Oct 15 17:10:18 2008
@@ -44,6 +44,12 @@
 
 <beans>
 
+	<bean id="PlutoServices"
+	      class="org.apache.pluto.services.PlutoServices"
+          singleton="true">
+      <constructor-arg><ref bean="RequiredContainerServices"/></constructor-arg>          	      
+	</bean>  
+	
     <bean id="RequiredContainerServices"
           name="OptionalContainerServices"
           class="org.apache.pluto.driver.services.container.ContainerServicesImpl"
@@ -51,6 +57,7 @@
       <constructor-arg><ref bean="PortalContext"/></constructor-arg>
       <constructor-arg><ref bean="DriverConfiguration"/></constructor-arg>
       <constructor-arg><ref bean="CCPPProfileService"/></constructor-arg>
+      <constructor-arg><ref bean="ContainerInvocationService"/></constructor-arg>
     </bean>
 
     <bean id="PortalContext"
@@ -77,6 +84,8 @@
       <constructor-arg><ref bean="PortalCallbackService"/></constructor-arg>
 
       <!--  Optional Container Services -->
+      <property name="portletRegistryService"><ref bean="PortletRegistryService"/></property>
+      
       <!--
       <property name="portletPreferencesService"><ref bean="PortletPreferencesService"/></property>
       <property name="userAttributeService"><ref bean="UserAttributeService"/></property>
@@ -135,4 +144,14 @@
     	  singleton="true">
     </bean>
 
+	<bean id='ContainerInvocationService'
+	      class='org.apache.pluto.core.ContainerInvocationServiceImpl'
+	      singleton='true'>
+	</bean>
+	
+	<bean id="PortletRegistryService"
+		  class="org.apache.pluto.core.PortletContextManager"
+		  singleton="true">
+    </bean>
+    
 </beans>
\ No newline at end of file

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-taglib/pom.xml
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-taglib/pom.xml?rev=705103&r1=705102&r2=705103&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-taglib/pom.xml (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-taglib/pom.xml Wed Oct 15 17:10:18 2008
@@ -32,13 +32,7 @@
     <name>Pluto Portlet Tag Library</name>
     <description>Pluto's Java Portlet Specification Tag Library implementation</description>
 
-    <dependencies>
-	    <dependency>
-            <groupId>org.apache.pluto</groupId>
-            <artifactId>pluto-container</artifactId>
-            <version>${pom.version}</version>
-            <scope>provided</scope>
-        </dependency>
+    <dependencies>    
         <dependency>
             <groupId>javax.portlet</groupId>
             <artifactId>portlet-api</artifactId>
@@ -57,11 +51,6 @@
             <version>${jsp-api.version}</version>
             <scope>provided</scope>
         </dependency>
-      <dependency>
-        <groupId>commons-logging</groupId>
-        <artifactId>commons-logging-api</artifactId>
-        <version>${commons-logging.version}</version>
-      </dependency>
 
         <dependency>
             <groupId>junit</groupId>

Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-taglib/src/main/java/org/apache/pluto/tags/el/ExpressionEvaluatorProxy.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-taglib/src/main/java/org/apache/pluto/tags/el/ExpressionEvaluatorProxy.java?rev=705103&r1=705102&r2=705103&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-taglib/src/main/java/org/apache/pluto/tags/el/ExpressionEvaluatorProxy.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-taglib/src/main/java/org/apache/pluto/tags/el/ExpressionEvaluatorProxy.java Wed Oct 15 17:10:18 2008
@@ -24,14 +24,8 @@
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.PageContext;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-
-public abstract class ExpressionEvaluatorProxy {
-
-    private static final Log LOG = LogFactory.getLog(ExpressionEvaluatorProxy.class);
-
+public abstract class ExpressionEvaluatorProxy 
+{
     private static final Map<String, String> FACTORIES = new TreeMap<String, String>();
 
     private static ExpressionEvaluatorProxy proxy;
@@ -49,11 +43,6 @@
                 try {
                     String className =
                         ExpressionEvaluatorProxy.class.getPackage().getName()+"."+entry.getValue();
-
-                    if(LOG.isInfoEnabled()) {
-                        LOG.info("Attempting to utilize expression evaluator proxy '"+className+"'");
-                    }
-
                     Class<?> proxyClass = Class.forName(className);
                     proxy = (ExpressionEvaluatorProxy)proxyClass.newInstance();
 
@@ -70,11 +59,10 @@
                 }
             }
         }
-        if(proxy == null) {
+        if(proxy == null) 
+        {
             throw new RuntimeException("Unable to find a supported proxy");
-        } else {
-            LOG.info("ExpressionEvaluator Proxy Found: "+proxy.getClass().getName());
-        }
+        } 
     }