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 2009/03/10 13:28:04 UTC

svn commit: r752091 - in /portals/pluto/trunk: pluto-container-api/src/main/java/org/apache/pluto/container/ pluto-container-api/src/main/java/org/apache/pluto/container/driver/ pluto-container-api/src/main/java/org/apache/pluto/container/spi/ pluto-co...

Author: ate
Date: Tue Mar 10 12:28:03 2009
New Revision: 752091

URL: http://svn.apache.org/viewvc?rev=752091&view=rev
Log:
PLUTO-537: Cleaning up Pluto packages
See: https://issues.apache.org/jira/browse/PLUTO-537

- move PortletRegistryService, PortletContextService and PortalAdministrationService to new o.a.p.container.driver.PortalDriverServices (these are not used/needed by the container)

- remove usage of PortletInfoService from ResourceBundleFactory and move "injecting" window specific PortletInfo to PortletConfigImpl internal (same as DefaultPortletInfoService impl)
As a PortletConfigImpl is portal specific anyway, overriding/implementing an alternative "window" PortletInfo is easily customizable.
The great benefit of removing this usage of the PortletInfoService is that now the PortletContainerInvocationService is no longer needed (and thus no ThreadLocals either)
The usage of the PortletContainerInvocationService for this purpose was dubious in the first place (only called on first access to the PortletConfig.getResourceBundle(locale)).

Coming up: removal of PortletContainerinvocationService and PortletInfoService
  

Added:
    portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/driver/PortalDriverServices.java   (with props)
Removed:
    portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/spi/
Modified:
    portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/OptionalContainerServices.java
    portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/driver/PlutoServices.java
    portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/driver/PortletServlet.java
    portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultOptionalContainerServices.java
    portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/PlutoContainerServices.java
    portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletConfigImpl.java
    portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/ResourceBundleFactory.java
    portals/pluto/trunk/pluto-container/src/test/java/org/apache/pluto/util/PlutoTestCase.java
    portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventProviderImpl.java
    portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java
    portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedWindowStateServiceImpl.java
    portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/core/PortletWindowImpl.java

Modified: portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/OptionalContainerServices.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/OptionalContainerServices.java?rev=752091&r1=752090&r2=752091&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/OptionalContainerServices.java (original)
+++ portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/OptionalContainerServices.java Tue Mar 10 12:28:03 2009
@@ -16,10 +16,6 @@
  */
 package org.apache.pluto.container;
 
-import org.apache.pluto.container.driver.PortalAdministrationService;
-import org.apache.pluto.container.driver.PortletContextService;
-import org.apache.pluto.container.driver.PortletRegistryService;
-
 /**
  * Defines the services necessary for integration between the Pluto Container
  * and a Portal.
@@ -58,24 +54,6 @@
     PortletEnvironmentService getPortletEnvironmentService();
 
     /**
-     * Returns the portlet registry services implementation
-     * used by the container.
-     *
-     * @return registry service implementation
-     */
-    PortletRegistryService getPortletRegistryService();
-
-
-    /**
-     * 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.
@@ -91,15 +69,6 @@
     PortletInfoService getPortletInfoService();
 
     /**
-     * Returns the admin service implementation used by
-     * the container.
-     *
-     * @return portal admin service
-     */
-    PortalAdministrationService getPortalAdministrationService();
-
-
-    /**
      * Returns the user info service implementation used
      * by the container.
      *

Modified: portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/driver/PlutoServices.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/driver/PlutoServices.java?rev=752091&r1=752090&r2=752091&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/driver/PlutoServices.java (original)
+++ portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/driver/PlutoServices.java Tue Mar 10 12:28:03 2009
@@ -32,9 +32,10 @@
 import org.apache.pluto.container.UserInfoService;
 
 
-public class PlutoServices implements ContainerServices
+public class PlutoServices implements ContainerServices, PortalDriverServices
 {
-    private ContainerServices provider;
+    private ContainerServices containerServices;
+    private PortalDriverServices driverServices;
     
     private static PlutoServices singleton;
 
@@ -43,83 +44,85 @@
         return singleton;
     }
     
-    public PlutoServices(ContainerServices provider)
+    public PlutoServices(ContainerServices containerServices, PortalDriverServices driverServices)
     {
         singleton = this;
-        this.provider = provider;
+        this.containerServices = containerServices;
+        this.driverServices = driverServices;
     }
+    
     public CCPPProfileService getCCPPProfileService()
     {
-        return provider.getCCPPProfileService();
+        return containerServices.getCCPPProfileService();
     }
 
     public ContainerInvocationService getContainerInvocationService()
     {
-        return provider.getContainerInvocationService();
+        return containerServices.getContainerInvocationService();
     }
 
     public PortalCallbackService getPortalCallbackService()
     {
-        return provider.getPortalCallbackService();
+        return containerServices.getPortalCallbackService();
     }
 
     public PortalContext getPortalContext()
     {
-        return provider.getPortalContext();
+        return containerServices.getPortalContext();
     }
 
     public NamespaceMapper getNamespaceMapper()
     {
-        return provider.getNamespaceMapper();
+        return containerServices.getNamespaceMapper();
     }
 
     public PortalAdministrationService getPortalAdministrationService()
     {
-        return provider.getPortalAdministrationService();
+        return driverServices.getPortalAdministrationService();
     }
 
     public PortletEnvironmentService getPortletEnvironmentService()
     {
-        return provider.getPortletEnvironmentService();
+        return containerServices.getPortletEnvironmentService();
     }
 
     public PortletInfoService getPortletInfoService()
     {
-        return provider.getPortletInfoService();
+        return containerServices.getPortletInfoService();
     }
 
     public PortletInvokerService getPortletInvokerService()
     {
-        return provider.getPortletInvokerService();
+        return containerServices.getPortletInvokerService();
     }
 
     public PortletPreferencesService getPortletPreferencesService()
     {
-        return provider.getPortletPreferencesService();
+        return containerServices.getPortletPreferencesService();
     }
 
     public PortletRegistryService getPortletRegistryService()
     {
-        return provider.getPortletRegistryService();
+        return driverServices.getPortletRegistryService();
     }
 
     public UserInfoService getUserInfoService()
     {
-        return provider.getUserInfoService();
+        return containerServices.getUserInfoService();
     }
     
     public PortletContextService getPortletContextService()
     {
-        return provider.getPortletContextService();
+        return driverServices.getPortletContextService();
     }
 
     public PortletRequestContextService getPortletRequestContextService()
     {
-        return provider.getPortletRequestContextService();
+        return containerServices.getPortletRequestContextService();
     }
 
     public EventCoordinationService getEventCoordinationService()
     {
-        return provider.getEventCoordinationService();
+        return containerServices.getEventCoordinationService();
     }
 }

Added: portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/driver/PortalDriverServices.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/driver/PortalDriverServices.java?rev=752091&view=auto
==============================================================================
--- portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/driver/PortalDriverServices.java (added)
+++ portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/driver/PortalDriverServices.java Tue Mar 10 12:28:03 2009
@@ -0,0 +1,54 @@
+/*
+ * 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.container.driver;
+
+/**
+ * Defines the optional services for the Pluto Portal Driver to integrate with the Pluto Container
+ * and accessed from the <code>org.apache.pluto.container.driver.PortletServlet</code>
+ * and the <code>org.apache.pluto.container.driver.impl.DefaultPortletInvokerService</code>.
+ * These services are not required nor used by the container itself directly.
+ *
+ * @since 2.0
+ * @version $Id$
+ */
+public interface PortalDriverServices
+{
+    /**
+     * Returns the portlet context services implementation
+     * used by the container.
+     *
+     * @return registry service implementation
+     */
+    PortletContextService getPortletContextService();
+
+    /**
+     * Returns the portlet registry services implementation
+     * used by the container.
+     *
+     * @return registry service implementation
+     */
+    PortletRegistryService getPortletRegistryService();
+
+    /**
+     * Returns the admin service implementation used by
+     * the container.
+     *
+     * @return portal admin service
+     */
+    PortalAdministrationService getPortalAdministrationService();
+}

Propchange: portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/driver/PortalDriverServices.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/driver/PortalDriverServices.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/driver/PortalDriverServices.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/driver/PortletServlet.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/driver/PortletServlet.java?rev=752091&r1=752090&r2=752091&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/driver/PortletServlet.java (original)
+++ portals/pluto/trunk/pluto-container-api/src/main/java/org/apache/pluto/container/driver/PortletServlet.java Tue Mar 10 12:28:03 2009
@@ -44,8 +44,6 @@
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.pluto.container.Constants;
-import org.apache.pluto.container.ContainerInvocation;
-import org.apache.pluto.container.ContainerInvocationService;
 import org.apache.pluto.container.ContainerPortletConfig;
 import org.apache.pluto.container.ContainerPortletContext;
 import org.apache.pluto.container.FilterManager;
@@ -128,8 +126,6 @@
 
     private PortletContextService contextService;
 
-    private ContainerInvocationService containerInvocationService;
-
     private boolean started = false;
     Timer   startTimer = null;
 
@@ -184,7 +180,6 @@
         if (PlutoServices.getServices() != null)
         {
             contextService = PlutoServices.getServices().getPortletContextService();
-            containerInvocationService = PlutoServices.getServices().getContainerInvocationService();
             try
             {
                 ServletConfig sConfig = getServletConfig();
@@ -380,12 +375,7 @@
             // The requested method is ADMIN: call handlers.
             else if (methodId == Constants.METHOD_ADMIN)
             {
-
-                ContainerInvocation inv = containerInvocationService
-                        .getInvocation();
-                PortalAdministrationService pas = inv.getPortletContainer()
-                        .getOptionalContainerServices()
-                        .getPortalAdministrationService();
+                PortalAdministrationService pas = PlutoServices.getServices().getPortalAdministrationService();
 
                 for (AdministrativeRequestListener l : pas.getAdministrativeRequestListeners())
                 {
@@ -444,10 +434,7 @@
 
     protected void notify(PortletInvocationEvent event, boolean pre, Throwable e)
     {
-        ContainerInvocation inv = containerInvocationService.getInvocation();
-        PortalAdministrationService pas = inv.getPortletContainer()
-                .getOptionalContainerServices()
-                .getPortalAdministrationService();
+        PortalAdministrationService pas = PlutoServices.getServices().getPortalAdministrationService();
 
         for (PortletInvocationListener listener : pas.getPortletInvocationListeners())
         {

Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultOptionalContainerServices.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultOptionalContainerServices.java?rev=752091&r1=752090&r2=752091&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultOptionalContainerServices.java (original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultOptionalContainerServices.java Tue Mar 10 12:28:03 2009
@@ -26,17 +26,18 @@
 import org.apache.pluto.container.PortletRequestContextService;
 import org.apache.pluto.container.UserInfoService;
 import org.apache.pluto.container.driver.PortalAdministrationService;
+import org.apache.pluto.container.driver.PortalDriverServices;
 import org.apache.pluto.container.driver.PortletContextService;
 import org.apache.pluto.container.driver.PortletRegistryService;
 import org.apache.pluto.descriptors.services.jaxb.PortletAppDescriptorServiceImpl;
 
 /**
- * Default Optional Container Services implementation.
+ * Default Optional Container Services and Portal Driver Services implementation.
  *
  * @version 1.0
  * @since Sep 18, 2004
  */
-public class DefaultOptionalContainerServices implements OptionalContainerServices {
+public class DefaultOptionalContainerServices implements OptionalContainerServices, PortalDriverServices {
 
     private PortletPreferencesService portletPreferencesService;
     private PortletRegistryService portletRegistryService;
@@ -74,18 +75,18 @@
      * be used. Otherwise, the default portlet preferences service will be used.
      * @param root  the root optional container services implementation.
      */
-    public DefaultOptionalContainerServices(OptionalContainerServices root) {
+    public DefaultOptionalContainerServices(OptionalContainerServices root, PortalDriverServices driverServices) {
         this();
         if (root.getPortletPreferencesService() != null) {
             portletPreferencesService = root.getPortletPreferencesService();
         }
 
-        if (root.getPortletRegistryService() != null) {
-            portletRegistryService = root.getPortletRegistryService();
+        if (driverServices.getPortletRegistryService() != null) {
+            portletRegistryService = driverServices.getPortletRegistryService();
         }
 
-        if (root.getPortletContextService() != null) {
-            portletContextService = root.getPortletContextService();
+        if (driverServices.getPortletContextService() != null) {
+            portletContextService = driverServices.getPortletContextService();
         }
 
         if(root.getPortletEnvironmentService() != null) {
@@ -108,8 +109,8 @@
             portletInfoService = root.getPortletInfoService();
         }
 
-        if(root.getPortalAdministrationService() != null) {
-            portalAdministrationService = root.getPortalAdministrationService();
+        if(driverServices.getPortalAdministrationService() != null) {
+            portalAdministrationService = driverServices.getPortalAdministrationService();
         }
 
 		if(root.getUserInfoService() != null) {

Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/PlutoContainerServices.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/PlutoContainerServices.java?rev=752091&r1=752090&r2=752091&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/PlutoContainerServices.java (original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/PlutoContainerServices.java Tue Mar 10 12:28:03 2009
@@ -33,11 +33,12 @@
 import org.apache.pluto.container.RequiredContainerServices;
 import org.apache.pluto.container.UserInfoService;
 import org.apache.pluto.container.driver.PortalAdministrationService;
+import org.apache.pluto.container.driver.PortalDriverServices;
 import org.apache.pluto.container.driver.PortletContextService;
 import org.apache.pluto.container.driver.PortletRegistryService;
 
 
-public class PlutoContainerServices implements ContainerServices
+public class PlutoContainerServices implements ContainerServices, PortalDriverServices
 {
     /*
      * required services
@@ -64,13 +65,16 @@
         
     public PlutoContainerServices()
     {
+        createDefaultPortalDriverServices();
         createDefaultRequiredServices();
         createDefaultOptionalServices();
     }
     
     public PlutoContainerServices(RequiredContainerServices required, OptionalContainerServices optional)
     {
-        this(required.getPortalContext(), required.getCCPPProfileService(), required.getContainerInvocationService(), required.getPortalCallbackService(), required.getEventCoordinationService(), optional);
+        this(required.getPortalContext(), required.getCCPPProfileService(), required.getContainerInvocationService(),
+             required.getPortalCallbackService(), required.getEventCoordinationService(), optional,
+             optional instanceof PortalDriverServices ? (PortalDriverServices) optional : null);
     }
 
     public PlutoContainerServices(PortalContext context,
@@ -84,6 +88,7 @@
         this.containerInvocation = containerInvocation;
         this.callbackService = callbackService;
         this.eventCoordinationService = eventCoordinationService;
+        this.createDefaultPortalDriverServices();
         this.createDefaultOptionalServices();
     }            
             
@@ -92,7 +97,8 @@
             ContainerInvocationService containerInvocation,
             PortalCallbackService callbackService,
             EventCoordinationService eventCoordinationService,
-            OptionalContainerServices optionalServices)  
+            OptionalContainerServices optionalServices,
+            PortalDriverServices portalDriverServices)  
     {
         this.context = context;
         this.ccppProfileService = ccppProfileService;
@@ -102,10 +108,10 @@
         portletPreferencesService = optionalServices.getPortletPreferencesService();
         if (portletPreferencesService == null)
             portletPreferencesService =  new DefaultPortletPreferencesService();
-        portletRegistryService = optionalServices.getPortletRegistryService();
+        portletRegistryService = portalDriverServices != null ? portalDriverServices.getPortletRegistryService() : null;
         if (portletRegistryService == null)
             portletRegistryService = new PortletContextManager();
-        portletContextService = optionalServices.getPortletContextService();
+        portletContextService = portalDriverServices != null ? portalDriverServices.getPortletContextService() : null;
         if (portletContextService == null && portletRegistryService instanceof PortletContextService)
         {
             portletContextService = (PortletContextService)portletRegistryService;
@@ -122,7 +128,7 @@
         portletInfoService = optionalServices.getPortletInfoService();
         if (portletInfoService == null)
             portletInfoService = new DefaultPortletInfoService();
-        portalAdministrationService = optionalServices.getPortalAdministrationService();
+        portalAdministrationService = portalDriverServices != null ? portalDriverServices.getPortalAdministrationService() : null;
         if (portalAdministrationService == null)
             portalAdministrationService = new DefaultPortalAdministrationService();
         userInfoService = optionalServices.getUserInfoService();
@@ -133,16 +139,20 @@
             namespaceMapper = new DefaultNamespaceMapper();
     }
     
-    protected void createDefaultOptionalServices() 
+    protected void createDefaultPortalDriverServices()
     {
-        portletPreferencesService = new DefaultPortletPreferencesService();
         portletRegistryService = new PortletContextManager();
         portletContextService = (PortletContextManager)portletRegistryService;
+        portalAdministrationService = new DefaultPortalAdministrationService();
+    }
+    
+    protected void createDefaultOptionalServices() 
+    {
+        portletPreferencesService = new DefaultPortletPreferencesService();
         portletInvokerService = new DefaultPortletInvokerService(portletContextService);
         portletRequestContextService = new DefaultPortletRequestContextService();
         portletEnvironmentService = new DefaultPortletEnvironmentService();
         portletInfoService = new DefaultPortletInfoService();
-        portalAdministrationService = new DefaultPortalAdministrationService();
         userInfoService = new DefaultUserInfoService();
         namespaceMapper = new DefaultNamespaceMapper();
     }

Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletConfigImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletConfigImpl.java?rev=752091&r1=752090&r2=752091&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletConfigImpl.java (original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletConfigImpl.java Tue Mar 10 12:28:03 2009
@@ -84,7 +84,7 @@
             LOG.debug("Resource Bundle requested: "+locale);
         }
         if (bundles == null) {
-            bundles = new ResourceBundleFactory(portlet);
+            bundles = new ResourceBundleFactory(portlet, portlet.getPortletInfo());
         }
         return bundles.getResourceBundle(locale);
     }

Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/ResourceBundleFactory.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/ResourceBundleFactory.java?rev=752091&r1=752090&r2=752091&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/ResourceBundleFactory.java (original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/ResourceBundleFactory.java Tue Mar 10 12:28:03 2009
@@ -24,10 +24,6 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.pluto.container.ContainerInvocation;
-import org.apache.pluto.container.PortletInfoService;
-import org.apache.pluto.container.PortletWindow;
-import org.apache.pluto.container.driver.PlutoServices;
 import org.apache.pluto.container.om.portlet.PortletDefinition;
 import org.apache.pluto.container.om.portlet.PortletInfo;
 import org.apache.pluto.util.StringManager;
@@ -61,7 +57,7 @@
      */
     private String bundleName;
 
-    public ResourceBundleFactory(PortletDefinition dd) {
+    public ResourceBundleFactory(PortletDefinition dd, PortletInfo windowInfo) {
         bundleName = dd.getResourceBundle();
         if(LOG.isDebugEnabled()) {
             LOG.debug("Resource Bundle Created: "+bundleName);
@@ -69,13 +65,11 @@
 
         PortletInfo info = dd.getPortletInfo();
 
-        PortletInfoService infoService = getPortletInfoService();
-        PortletWindow window = getWindow();
-
+        
         if(info != null) {
-            String title = infoService == null ? info.getTitle() : infoService.getTitle(window);
-            String shortTitle = infoService == null ? info.getShortTitle() : infoService.getShortTitle(window);
-            String keywords = infoService == null ? info.getKeywords() : infoService.getKeywords(window);
+            String title = windowInfo == null ? info.getTitle() : windowInfo.getTitle();
+            String shortTitle = windowInfo == null ? info.getShortTitle() : windowInfo.getShortTitle();
+            String keywords = windowInfo == null ? info.getKeywords() : windowInfo.getKeywords();
 
             defaultBundle = new InlinePortletResourceBundle(
                 title, shortTitle, keywords
@@ -118,25 +112,4 @@
         }
        return (ResourceBundle)bundles.get(locale);
     }
-
-
-    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 = PlutoServices.getServices().getContainerInvocationService().getInvocation();
-//        ContainerInvocationImpl invocation = ContainerInvocationImpl.getInvocation();
-        if(invocation != null) {
-            return invocation.getPortletWindow();
-        }
-        return null;
-    }
 }

Modified: portals/pluto/trunk/pluto-container/src/test/java/org/apache/pluto/util/PlutoTestCase.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/test/java/org/apache/pluto/util/PlutoTestCase.java?rev=752091&r1=752090&r2=752091&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container/src/test/java/org/apache/pluto/util/PlutoTestCase.java (original)
+++ portals/pluto/trunk/pluto-container/src/test/java/org/apache/pluto/util/PlutoTestCase.java Tue Mar 10 12:28:03 2009
@@ -19,7 +19,6 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 
-import org.apache.pluto.container.ContainerServices;
 import org.apache.pluto.container.driver.PlutoServices;
 import org.apache.pluto.core.PlutoContainerServices;
 import org.jmock.MockObjectTestCase;
@@ -35,8 +34,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);
+        PlutoContainerServices containerServices = new PlutoContainerServices();
+        new PlutoServices(containerServices, containerServices);
     }
 
     protected void assertException(Object target, String methodName,

Modified: portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventProviderImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventProviderImpl.java?rev=752091&r1=752090&r2=752091&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventProviderImpl.java (original)
+++ portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/container/EventProviderImpl.java Tue Mar 10 12:28:03 2009
@@ -46,6 +46,7 @@
 import org.apache.pluto.container.PortletContainer;
 import org.apache.pluto.container.PortletContainerException;
 import org.apache.pluto.container.PortletWindow;
+import org.apache.pluto.container.driver.PlutoServices;
 import org.apache.pluto.container.driver.PortletContextService;
 import org.apache.pluto.container.driver.PortletRegistryService;
 import org.apache.pluto.container.om.portlet.EventDefinition;
@@ -272,9 +273,7 @@
 		QName eventName = event.getQName();
 		Collection<PortletWindowConfig> portlets = getAllPortlets(driverConfig);
         if (portletRegistry == null) {
-            portletRegistry = ((PortletContainer) containerServletContext
-                    .getAttribute(AttributeKeys.PORTLET_CONTAINER))
-                    .getOptionalContainerServices().getPortletRegistryService();
+            portletRegistry = PlutoServices.getServices().getPortletRegistryService();
         }
 
 		for (PortletWindowConfig portlet : portlets) {
@@ -385,7 +384,7 @@
 			EventContainer eventContainer, PortletWindowConfig config,
 			PortletWindow window, ServletContext containerServletContext) {
 		if (portletContextService == null) {
-			portletContextService = container.getOptionalContainerServices().getPortletContextService();
+			portletContextService = PlutoServices.getServices().getPortletContextService();
 		}
 		if (portletContextService != null){
 			String windowID = window.getId().getStringId();
@@ -530,9 +529,7 @@
 		String portletName = PortletWindowConfig
 				.parsePortletName(portletWindow.getId().getStringId());
 		if (portletRegistry == null) {
-			portletRegistry = ((PortletContainer) servletContext
-					.getAttribute(AttributeKeys.PORTLET_CONTAINER))
-					.getOptionalContainerServices().getPortletRegistryService();
+			portletRegistry = PlutoServices.getServices().getPortletRegistryService();
 		}
 		List<? extends EventDefinitionReference> events = null;
 		try {

Modified: portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java?rev=752091&r1=752090&r2=752091&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java (original)
+++ portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java Tue Mar 10 12:28:03 2009
@@ -26,7 +26,6 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.pluto.container.PortletContainer;
 import org.apache.pluto.container.PortletContainerException;
 import org.apache.pluto.container.driver.PlutoServices;
 import org.apache.pluto.container.driver.PortletContextService;
@@ -35,7 +34,6 @@
 import org.apache.pluto.container.om.portlet.PortletDefinition;
 import org.apache.pluto.container.om.portlet.Supports;
 import org.apache.pluto.descriptors.portlet.CustomPortletModeType;
-import org.apache.pluto.driver.AttributeKeys;
 import org.apache.pluto.driver.config.DriverConfigurationException;
 import org.apache.pluto.driver.services.portal.PortletWindowConfig;
 import org.apache.pluto.driver.services.portal.PropertyConfigService;
@@ -105,10 +103,7 @@
         // per render request, store a reference to the registry instead of looking
         // it up each time.  Is this premature optimization?
         if (portletRegistry == null) {
-            portletRegistry = ((PortletContainer)servletContext
-                    .getAttribute(AttributeKeys.PORTLET_CONTAINER))
-                    .getOptionalContainerServices()
-                    .getPortletRegistryService();
+            portletRegistry = PlutoServices.getServices().getPortletRegistryService();
         }
 
         try {
@@ -160,7 +155,7 @@
 
     public void init(ServletContext ctx) throws DriverConfigurationException {
         this.servletContext = ctx;
-        this.portletContextService = portletContextService = PlutoServices.getServices().getPortletContextService();
+        this.portletContextService = PlutoServices.getServices().getPortletContextService();
         loadPortalModes();
     }    
     
@@ -186,10 +181,7 @@
 	public boolean isPortletManagedMode(String portletId, String mode) {
 
 		if (portletRegistry == null) {
-            portletRegistry = ((PortletContainer)servletContext
-                    .getAttribute(AttributeKeys.PORTLET_CONTAINER))
-                    .getOptionalContainerServices()
-                    .getPortletRegistryService();
+            portletRegistry = PlutoServices.getServices().getPortletRegistryService();
         }
         //
         
@@ -240,10 +232,7 @@
 	        // per render request, store a reference to the registry instead of looking
 	        // it up each time.  Is this premature optimization?
 	        if (portletRegistry == null) {
-	            portletRegistry = ((PortletContainer)servletContext
-	                    .getAttribute(AttributeKeys.PORTLET_CONTAINER))
-	                    .getOptionalContainerServices()
-	                    .getPortletRegistryService();
+	            portletRegistry = PlutoServices.getServices().getPortletRegistryService();
 	        }
 
             if (portletRegistry == null) {
@@ -283,10 +272,7 @@
 	        }
 	        String portletName = PortletWindowConfig.parsePortletName(portletId);
 	        if (portletRegistry == null) {
-	            portletRegistry = ((PortletContainer)servletContext
-	                    .getAttribute(AttributeKeys.PORTLET_CONTAINER))
-	                    .getOptionalContainerServices()
-	                    .getPortletRegistryService();
+	            portletRegistry = PlutoServices.getServices().getPortletRegistryService();
 	        }
 	        
 		return portletContextService.getPortletConfig(applicationName, portletName);

Modified: portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedWindowStateServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedWindowStateServiceImpl.java?rev=752091&r1=752090&r2=752091&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedWindowStateServiceImpl.java (original)
+++ portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedWindowStateServiceImpl.java Tue Mar 10 12:28:03 2009
@@ -26,12 +26,11 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.pluto.container.PortletContainer;
 import org.apache.pluto.container.PortletContainerException;
+import org.apache.pluto.container.driver.PlutoServices;
 import org.apache.pluto.container.driver.PortletRegistryService;
 import org.apache.pluto.container.om.portlet.CustomWindowState;
 import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
-import org.apache.pluto.driver.AttributeKeys;
 import org.apache.pluto.driver.config.DriverConfigurationException;
 import org.apache.pluto.driver.services.portal.PortletWindowConfig;
 import org.apache.pluto.driver.services.portal.PropertyConfigService;
@@ -232,26 +231,6 @@
 
     private PortletRegistryService getPortletRegistryService()
     {
-        PortletContainer container = ((PortletContainer)servletContext                    
-                .getAttribute(AttributeKeys.PORTLET_CONTAINER));
-        
-        if ( container == null )
-        {
-            // should never happen
-            final String msg = "Unable to obtain an instance of the container.";
-            LOG.fatal( msg );
-            throw new NullPointerException( msg );
-        }       
-        
-        if ( container.getOptionalContainerServices() == null ||
-             container.getOptionalContainerServices().getPortletRegistryService() == null )
-        {
-            final String msg = "Unable to obtain the portlet registry.  The supported window state " +
-                "service cannot support custom window states.";
-            LOG.info( msg );
-            return null;
-        }
-        
-        return container.getOptionalContainerServices().getPortletRegistryService();
+        return PlutoServices.getServices().getPortletRegistryService();
     }
 }

Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/core/PortletWindowImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/core/PortletWindowImpl.java?rev=752091&r1=752090&r2=752091&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/core/PortletWindowImpl.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/core/PortletWindowImpl.java Tue Mar 10 12:28:03 2009
@@ -26,6 +26,7 @@
 import org.apache.pluto.container.PortletEntity;
 import org.apache.pluto.container.PortletWindow;
 import org.apache.pluto.container.PortletWindowID;
+import org.apache.pluto.container.driver.PlutoServices;
 import org.apache.pluto.driver.services.portal.PortletWindowConfig;
 import org.apache.pluto.driver.url.PortalURL;
 import org.apache.pluto.internal.impl.PortletEntityImpl;
@@ -63,7 +64,7 @@
             {
                 applicationName = applicationName.substring(1);
             }
-            this.entity = new PortletEntityImpl(container.getOptionalContainerServices().getPortletRegistryService().getPortlet(applicationName, config.getPortletName()));
+            this.entity = new PortletEntityImpl(PlutoServices.getServices().getPortletRegistryService().getPortlet(applicationName, config.getPortletName()));
         }
         catch (PortletContainerException ex)
         {