incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1362405 [1/2] - in /sling/whiteboard/portal/container: ./ src/main/java/org/apache/sling/portal/container/ src/main/java/org/apache/sling/portal/container/internal/ src/main/java/org/apache/sling/portal/container/internal/impl/ src/main/ja...
Date Tue, 17 Jul 2012 08:27:10 GMT
Author: cziegeler
Date: Tue Jul 17 08:27:09 2012
New Revision: 1362405

URL: http://svn.apache.org/viewvc?rev=1362405&view=rev
Log:
Add spi interfaces for pluggin in custom services, clean up the code a little bit, switch to annotations and start implementing event handling

Added:
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/impl/SlingPortletEntityImpl.java   (with props)
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PortalCCPPProfileService.java   (with props)
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PortalEventCoordinatorService.java   (with props)
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/spi/PortalUserInfoService.java   (with props)
Removed:
    sling/whiteboard/portal/container/LICENSE
    sling/whiteboard/portal/container/NOTICE
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/PortletEntityRegistryListener.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/SlingContainerServices.java
    sling/whiteboard/portal/container/src/main/resources/
Modified:
    sling/whiteboard/portal/container/pom.xml
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/PortletRegistryService.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/PortletWindowManager.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/SlingPortletContainer.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/SlingPortletEntity.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/SlingPortletWindowId.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/ContainerServicesImpl.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortletContainer.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortletWindowManager.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultUserInfoService.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DummyCCPPProfileServiceImpl.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DummyProfile.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/EventCoordinationServiceImpl.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/EventProviderImpl.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletActionResponseContextImpl.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletContainerImpl.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletEventResponseContextImpl.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletMimeResponseContextImpl.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletRenderResponseContextImpl.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletRequestContextServiceImpl.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletResourceResponseContextImpl.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletResponseContextImpl.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletStateAwareResponseContextImpl.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/impl/DefaultPortalURLFactory.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/impl/PortletWindowIDImpl.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/request/LinkTransformerFactory.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/request/PortalFilter.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/services/DefaultContainerInfo.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/services/DefaultNamespaceMapper.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/services/DefaultPortletInvokerService.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/services/DefaultPortletPreferencesService.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/services/DefaultPortletRegistryService.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/services/FilterManagerServiceImpl.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/ui/UIServlet.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/util/ContextPathUtil.java
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/util/PortalUtil.java

Modified: sling/whiteboard/portal/container/pom.xml
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/pom.xml?rev=1362405&r1=1362404&r2=1362405&view=diff
==============================================================================
--- sling/whiteboard/portal/container/pom.xml (original)
+++ sling/whiteboard/portal/container/pom.xml Tue Jul 17 08:27:09 2012
@@ -69,7 +69,8 @@
                             *
                         </Import-Package>
                         <Export-Package>
-                            org.apache.sling.portal.container
+                            org.apache.sling.portal.container,
+                            org.apache.sling.portal.container.spi;version:=1.0
                         </Export-Package>    
                         <Private-Package>
                             org.apache.sling.portal.container.internal,
@@ -197,14 +198,24 @@
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.jcr.api</artifactId>
+            <version>2.1.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.jcr.resource</artifactId>
-            <version>2.0.4-incubator</version>
+            <version>2.0.10</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
+            <groupId>javax.jcr</groupId>
+            <artifactId>jcr</artifactId>
+        </dependency>
+        <dependency>
             <groupId>org.apache.jackrabbit</groupId>
             <artifactId>jackrabbit-jcr-commons</artifactId>
-            <version>1.4.2</version>
+            <version>2.2.0</version>
             <scope>provided</scope>
         </dependency>
     </dependencies>

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/PortletRegistryService.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/PortletRegistryService.java?rev=1362405&r1=1362404&r2=1362405&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/PortletRegistryService.java (original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/PortletRegistryService.java Tue Jul 17 08:27:09 2012
@@ -57,8 +57,4 @@ public interface PortletRegistryService
     void addApplicationListener(ApplicationRegistryListener listener);
 
     void removeApplicationListener(ApplicationRegistryListener listener);
-
-    void addPortletEntityListener(PortletEntityRegistryListener listener);
-
-    void removePortletEntityListener(PortletEntityRegistryListener listener);
 }
\ No newline at end of file

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/PortletWindowManager.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/PortletWindowManager.java?rev=1362405&r1=1362404&r2=1362405&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/PortletWindowManager.java (original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/PortletWindowManager.java Tue Jul 17 08:27:09 2012
@@ -16,7 +16,6 @@
  */
 package org.apache.sling.portal.container;
 
-import org.apache.pluto.container.PortletWindow;
 import org.apache.sling.api.resource.ValueMap;
 
 public interface PortletWindowManager {
@@ -28,7 +27,7 @@ public interface PortletWindowManager {
      * @param config portlet window configuration
      * @return  The corresponding portlet window.
      */
-    PortletWindow getPortletWindow(PortletEntityId id, String windowId, ValueMap config);
+    SlingPortletWindow getPortletWindow(PortletEntityId id, String windowId, ValueMap config);
 
     /**
      * Get the portlet window for window id
@@ -36,5 +35,5 @@ public interface PortletWindowManager {
      * @param config portlet window configuration
      * @return  The corresponding portlet window.
      */
-    PortletWindow getPortletWindow(String windowId, ValueMap config);
+    SlingPortletWindow getPortletWindow(String windowId, ValueMap config);
 }

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/SlingPortletContainer.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/SlingPortletContainer.java?rev=1362405&r1=1362404&r2=1362405&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/SlingPortletContainer.java (original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/SlingPortletContainer.java Tue Jul 17 08:27:09 2012
@@ -17,6 +17,7 @@
 package org.apache.sling.portal.container;
 
 import org.apache.pluto.container.PortletContainer;
+import org.apache.sling.portal.container.spi.PortalEventCoordinatorService;
 
 /**
  * This is an extension of the portlet container
@@ -31,7 +32,6 @@ public interface SlingPortletContainer e
 
     /**
      * Get the window manager
-     * @param request The current request.
      * @return The portlet window manager.
      */
     PortletWindowManager getPortletWindowManager();
@@ -40,4 +40,9 @@ public interface SlingPortletContainer e
      * Get the portlet registry service.
      */
     PortletRegistryService getPortletRegistryService();
+
+    /**
+     * Get the event coordinator.
+     */
+    PortalEventCoordinatorService getPortalEventCoordinatorService();
 }

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/SlingPortletEntity.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/SlingPortletEntity.java?rev=1362405&r1=1362404&r2=1362405&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/SlingPortletEntity.java (original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/SlingPortletEntity.java Tue Jul 17 08:27:09 2012
@@ -18,19 +18,33 @@ package org.apache.sling.portal.containe
 
 import javax.portlet.Portlet;
 
-
 /**
  * This object holds all relevant pieces of a portlet.
  */
 public interface SlingPortletEntity {
 
+    /** The portlet configuration. */
     SlingPortletConfig getPortletConfig();
 
+    /** The portlet context. */
     SlingPortletContext getPortletContext();
 
+    /** Is this portlet loaded? */
     boolean isLoaded();
 
+    /** The portlet object. */
     Portlet getPortlet();
 
+    /** The portlet entity id. */
     PortletEntityId getPortletEntityId();
+
+    /**
+     * Get the named attribute.
+     */
+    Object getAttribute(String name);
+
+    /**
+     * Store the named attribute
+     */
+    void setAttribute(String name, Object value);
 }
\ No newline at end of file

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/SlingPortletWindowId.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/SlingPortletWindowId.java?rev=1362405&r1=1362404&r2=1362405&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/SlingPortletWindowId.java (original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/SlingPortletWindowId.java Tue Jul 17 08:27:09 2012
@@ -16,12 +16,10 @@
  */
 package org.apache.sling.portal.container;
 
-import javax.portlet.PortletConfig;
-
 import org.apache.pluto.container.PortletWindowID;
 
 /**
- * This is an extension of the {@link PortletConfig} which
+ * This is an extension of the {@link PortletWindowID} which
  * stores additional information.
  */
 public interface SlingPortletWindowId extends PortletWindowID {

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/ContainerServicesImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/ContainerServicesImpl.java?rev=1362405&r1=1362404&r2=1362405&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/ContainerServicesImpl.java (original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/ContainerServicesImpl.java Tue Jul 17 08:27:09 2012
@@ -16,10 +16,15 @@
  */
 package org.apache.sling.portal.container.internal;
 
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
 import javax.portlet.PortalContext;
 
 import org.apache.pluto.container.CCPPProfileService;
 import org.apache.pluto.container.ContainerInfo;
+import org.apache.pluto.container.ContainerServices;
 import org.apache.pluto.container.EventCoordinationService;
 import org.apache.pluto.container.FilterManagerService;
 import org.apache.pluto.container.NamespaceMapper;
@@ -32,19 +37,24 @@ import org.apache.pluto.container.Reques
 import org.apache.pluto.container.UserInfoService;
 import org.apache.pluto.container.impl.PortletEnvironmentServiceImpl;
 import org.apache.pluto.container.impl.RequestDispatcherServiceImpl;
+import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.jcr.api.SlingRepository;
 import org.apache.sling.portal.container.PortletRegistryService;
 import org.apache.sling.portal.container.PortletWindowManager;
-import org.apache.sling.portal.container.SlingContainerServices;
+import org.apache.sling.portal.container.SlingPortletEntity;
+import org.apache.sling.portal.container.SlingPortletWindow;
 import org.apache.sling.portal.container.internal.services.DefaultNamespaceMapper;
 import org.apache.sling.portal.container.internal.services.DefaultPortletInvokerService;
 import org.apache.sling.portal.container.internal.services.DefaultPortletPreferencesService;
 import org.apache.sling.portal.container.internal.services.DefaultPortletRegistryService;
 import org.apache.sling.portal.container.internal.services.FilterManagerServiceImpl;
+import org.apache.sling.portal.container.spi.PortalCCPPProfileService;
+import org.apache.sling.portal.container.spi.PortalEventCoordinatorService;
+import org.apache.sling.portal.container.spi.PortalUserInfoService;
 import org.osgi.framework.BundleContext;
 import org.osgi.util.tracker.ServiceTracker;
 
-public class ContainerServicesImpl implements SlingContainerServices {
+public class ContainerServicesImpl implements ContainerServices {
 
     /**
      * required services
@@ -52,13 +62,11 @@ public class ContainerServicesImpl imple
     private final PortalContext context;
     private final EventCoordinationService eventCoordinationService;
     private final PortletRequestContextService portletRequestContextService;
-    private final CCPPProfileService defaultCcppProfileService;
     private final FilterManagerServiceImpl filterManagerService;
     private final PortletURLListenerService portletURLListenerService;
     private final DefaultPortletPreferencesService portletPreferencesService;
     private final PortletInvokerService portletInvokerService;
     private final PortletEnvironmentService portletEnvironmentService;
-    private final UserInfoService userInfoService;
     private final NamespaceMapper namespaceMapper;
     private final RequestDispatcherService rds = new RequestDispatcherServiceImpl(2);
 
@@ -68,7 +76,15 @@ public class ContainerServicesImpl imple
     private final PortletRegistryService registry;
     private final PortletWindowManager windowManager;
 
+    /**
+     * Pluggable services.
+     */
+    private final CCPPProfileService defaultCcppProfileService;
+    private final UserInfoService defaultUserInfoService;
+    private final PortalEventCoordinatorService defaultEventCoordinator;
     private final ServiceTracker ccppProfileServiceTracker;
+    private final ServiceTracker userInfoServiceTracker;
+    private final ServiceTracker eventCoordinatorServiceTracker;
 
     /**
      * Default Constructor.
@@ -86,15 +102,35 @@ public class ContainerServicesImpl imple
             this.portletRequestContextService = new PortletRequestContextServiceImpl();
             this.filterManagerService = new FilterManagerServiceImpl(this.registry);
             this.portletURLListenerService = new PortletURLListenerImpl();
-            this.ccppProfileServiceTracker = new ServiceTracker(bundleContext, CCPPProfileService.class.getName(), null);
-            this.ccppProfileServiceTracker.open();
-            this.defaultCcppProfileService = new DummyCCPPProfileServiceImpl();
-            this.portletPreferencesService = new DefaultPortletPreferencesService(repository, registry);
+            this.portletPreferencesService = new DefaultPortletPreferencesService(repository);
             this.portletInvokerService = new DefaultPortletInvokerService(registry);
             this.portletEnvironmentService = new PortletEnvironmentServiceImpl();
-            this.userInfoService = new DefaultUserInfoService();
             this.namespaceMapper = new DefaultNamespaceMapper();
             this.windowManager = new DefaultPortletWindowManager(this.registry);
+
+            this.defaultCcppProfileService = new DummyCCPPProfileServiceImpl();
+            this.ccppProfileServiceTracker = new ServiceTracker(bundleContext, PortalCCPPProfileService.class.getName(), null);
+            this.ccppProfileServiceTracker.open();
+
+            this.defaultUserInfoService = new DefaultUserInfoService();
+            this.userInfoServiceTracker = new ServiceTracker(bundleContext, PortalUserInfoService.class.getName(), null);
+            this.userInfoServiceTracker.open();
+
+            this.defaultEventCoordinator = new PortalEventCoordinatorService() {
+
+                public List<SlingPortletWindow> getPortletWindow(final SlingHttpServletRequest request) {
+                    final List<SlingPortletWindow> windows = new ArrayList<SlingPortletWindow>();
+                    final Iterator<SlingPortletEntity> i = registry.getPortletEntities();
+                    while ( i.hasNext() ) {
+                        final SlingPortletEntity entity = i.next();
+                        windows.add(windowManager.getPortletWindow(entity.getPortletEntityId(), null, null));
+                    }
+
+                    return windows;
+                }
+            };
+            this.eventCoordinatorServiceTracker = new ServiceTracker(bundleContext, PortalEventCoordinatorService.class.getName(), null);
+            this.eventCoordinatorServiceTracker.open();
             noErrors = true;
         } finally {
             if ( !noErrors ) {
@@ -103,6 +139,9 @@ public class ContainerServicesImpl imple
         }
     }
 
+    /**
+     * Destroy this instance and clean up.
+     */
     public void destroy() {
         if ( this.portletPreferencesService != null ) {
             this.portletPreferencesService.destroy();
@@ -113,6 +152,12 @@ public class ContainerServicesImpl imple
         if ( this.ccppProfileServiceTracker != null ) {
             this.ccppProfileServiceTracker.close();
         }
+        if ( this.userInfoServiceTracker != null ) {
+            this.userInfoServiceTracker.close();
+        }
+        if ( this.eventCoordinatorServiceTracker != null ) {
+            this.eventCoordinatorServiceTracker.close();
+        }
     }
 
     /**
@@ -165,7 +210,11 @@ public class ContainerServicesImpl imple
      * @see org.apache.pluto.container.ContainerServices#getUserInfoService()
      */
     public UserInfoService getUserInfoService() {
-        return this.userInfoService;
+        UserInfoService service = (UserInfoService)this.userInfoServiceTracker.getService();
+        if ( service == null ) {
+            service = defaultUserInfoService;
+        }
+        return service;
     }
 
     /**
@@ -197,20 +246,25 @@ public class ContainerServicesImpl imple
     }
 
     /**
-     * @see org.apache.sling.portal.container.SlingContainerServices#getPortletRegistryService()
+     * @see org.apache.pluto.container.ContainerServices#getRequestDispatcherService()
      */
+    public RequestDispatcherService getRequestDispatcherService() {
+        return this.rds;
+    }
+
     public PortletRegistryService getPortletRegistryService() {
         return this.registry;
     }
 
-    /**
-     * @see org.apache.sling.portal.container.SlingContainerServices#getPortletWindowManager()
-     */
     public PortletWindowManager getPortletWindowManager() {
         return this.windowManager;
     }
 
-    public RequestDispatcherService getRequestDispatcherService() {
-        return this.rds;
+    public PortalEventCoordinatorService getPortalEventCoordinatorService() {
+        PortalEventCoordinatorService service = (PortalEventCoordinatorService) this.eventCoordinatorServiceTracker.getService();
+        if ( service == null ) {
+            service = this.defaultEventCoordinator;
+        }
+        return service;
     }
 }

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortletContainer.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortletContainer.java?rev=1362405&r1=1362404&r2=1362405&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortletContainer.java (original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortletContainer.java Tue Jul 17 08:27:09 2012
@@ -39,6 +39,7 @@ import org.apache.sling.portal.container
 import org.apache.sling.portal.container.SlingPortletContainer;
 import org.apache.sling.portal.container.SlingPortletWindow;
 import org.apache.sling.portal.container.internal.services.DefaultContainerInfo;
+import org.apache.sling.portal.container.spi.PortalEventCoordinatorService;
 import org.osgi.framework.BundleContext;
 import org.osgi.service.component.ComponentContext;
 import org.slf4j.Logger;
@@ -81,7 +82,7 @@ public class DefaultPortletContainer imp
         this.bundleContext = null;
         try {
             this.destroy();
-        } catch (PortletContainerException e) {
+        } catch (final PortletContainerException e) {
             this.logger.error("Error during shutdown of portlet container.", e);
         }
     }
@@ -122,9 +123,9 @@ public class DefaultPortletContainer imp
             }
 
             logger.debug("Portlet container initialized.");
-        } catch (PortletContainerException pce) {
+        } catch (final PortletContainerException pce) {
             throw pce;
-        } catch (Exception e) {
+        } catch (final Exception e) {
             throw new PortletContainerException("Unable to initialize container.", e);
         }
     }
@@ -241,7 +242,7 @@ public class DefaultPortletContainer imp
     public ContainerServices getContainerServices() {
         try {
             checkInit();
-        } catch (PortletContainerException e) {
+        } catch (final PortletContainerException e) {
             logger.error("Unable to start portlet container", e);
             return null;
         }
@@ -281,7 +282,7 @@ public class DefaultPortletContainer imp
     public PortletWindowManager getPortletWindowManager() {
         try {
             checkInit();
-        } catch (PortletContainerException e) {
+        } catch (final PortletContainerException e) {
             logger.error("Unable to start portlet container", e);
             return null;
         }
@@ -294,10 +295,20 @@ public class DefaultPortletContainer imp
     public PortletRegistryService getPortletRegistryService() {
         try {
             checkInit();
-        } catch (PortletContainerException e) {
+        } catch (final PortletContainerException e) {
             logger.error("Unable to start portlet container", e);
             return null;
         }
         return this.portletContainer.getPortletRegistryService();
     }
+
+    public PortalEventCoordinatorService getPortalEventCoordinatorService() {
+        try {
+            checkInit();
+        } catch (final PortletContainerException e) {
+            logger.error("Unable to start portlet container", e);
+            return null;
+        }
+        return this.portletContainer.getPortalEventCoordinatorService();
+    }
 }

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortletWindowManager.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortletWindowManager.java?rev=1362405&r1=1362404&r2=1362405&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortletWindowManager.java (original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultPortletWindowManager.java Tue Jul 17 08:27:09 2012
@@ -20,13 +20,13 @@ import javax.portlet.PortletMode;
 import javax.portlet.WindowState;
 
 import org.apache.pluto.container.PortletContainerException;
-import org.apache.pluto.container.PortletWindow;
 import org.apache.pluto.container.PortletWindowID;
 import org.apache.sling.api.resource.ValueMap;
 import org.apache.sling.portal.container.PortletEntityId;
 import org.apache.sling.portal.container.PortletRegistryService;
 import org.apache.sling.portal.container.PortletWindowManager;
 import org.apache.sling.portal.container.SlingPortletEntity;
+import org.apache.sling.portal.container.SlingPortletWindow;
 import org.apache.sling.portal.container.SlingPortletWindowId;
 import org.apache.sling.portal.container.internal.impl.PortletWindowIDImpl;
 import org.apache.sling.portal.container.internal.impl.PortletWindowImpl;
@@ -40,7 +40,7 @@ import org.slf4j.LoggerFactory;
 public class DefaultPortletWindowManager implements PortletWindowManager {
 
     /** The logger. */
-    private final static Logger LOGGER = LoggerFactory.getLogger(DefaultPortletWindowManager.class);
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
 
     private final PortletRegistryService registry;
 
@@ -51,7 +51,7 @@ public class DefaultPortletWindowManager
     /**
      * @see org.apache.sling.portal.container.PortletWindowManager#getPortletWindow(org.apache.sling.portal.container.PortletEntityId, java.lang.String, org.apache.sling.api.resource.ValueMap)
      */
-    public PortletWindow getPortletWindow(PortletEntityId id, String window, final ValueMap configuration) {
+    public SlingPortletWindow getPortletWindow(PortletEntityId id, String window, final ValueMap configuration) {
         final PortletWindowID windowId = PortletWindowIDImpl.createFromIdentifier(id, window);
         return this.getPortletWindow(id, windowId, configuration);
     }
@@ -59,28 +59,28 @@ public class DefaultPortletWindowManager
     /**
      * @see org.apache.sling.portal.container.PortletWindowManager#getPortletWindow(java.lang.String, org.apache.sling.api.resource.ValueMap)
      */
-    public PortletWindow getPortletWindow(final String windowId, final ValueMap configuration) {
+    public SlingPortletWindow getPortletWindow(final String windowId, final ValueMap configuration) {
         final SlingPortletWindowId window = PortletWindowIDImpl.createFromString(windowId);
         return this.getPortletWindow(window.getPortletEntityId(), window, configuration);
     }
 
-    protected PortletWindow getPortletWindow(final PortletEntityId id,
+    protected SlingPortletWindow getPortletWindow(final PortletEntityId id,
                                              final PortletWindowID windowId,
                                              final ValueMap configuration) {
         SlingPortletEntity info = null;
         try {
             info = this.registry.getPortletEntity(id);
             if ( info == null ) {
-                LOGGER.info("Portlet entity for " + id  + " not found in registry.");
+                logger.info("Portlet entity for " + id  + " not found in registry.");
                 return null;
             }
         } catch (PortletContainerException e) {
-            LOGGER.error("Unable to retrieve portlet window for " + windowId, e);
+            logger.error("Unable to retrieve portlet window for " + windowId, e);
             return null;
         }
         final PortalRequestContext prc = PortalRequestContext.getContext();
         if ( prc == null ) {
-            LOGGER.error("Portlet filter is not enabled.");
+            logger.error("Portlet filter is not enabled.");
             return null;
         }
         final PortletMode portletMode = prc.getRequestedPortalURL().getPortletMode(windowId.getStringId());

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultUserInfoService.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultUserInfoService.java?rev=1362405&r1=1362404&r2=1362405&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultUserInfoService.java (original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DefaultUserInfoService.java Tue Jul 17 08:27:09 2012
@@ -32,8 +32,8 @@ import org.apache.pluto.container.UserIn
  */
 public class DefaultUserInfoService implements UserInfoService {
 
-    public Map<String, String> getUserInfo(PortletRequest request, PortletWindow window)
-        throws PortletContainerException {
+    public Map<String, String> getUserInfo(final PortletRequest request, final PortletWindow window)
+    throws PortletContainerException {
         if ( request.getRemoteUser() != null ) {
             return Collections.emptyMap();
         }

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DummyCCPPProfileServiceImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DummyCCPPProfileServiceImpl.java?rev=1362405&r1=1362404&r2=1362405&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DummyCCPPProfileServiceImpl.java (original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DummyCCPPProfileServiceImpl.java Tue Jul 17 08:27:09 2012
@@ -31,7 +31,7 @@ public class DummyCCPPProfileServiceImpl
 	/**
 	 * @see org.apache.pluto.container.CCPPProfileService#getCCPPProfile(javax.servlet.http.HttpServletRequest)
 	 */
-	public Profile getCCPPProfile(HttpServletRequest httpServletRequest) {
+	public Profile getCCPPProfile(final HttpServletRequest httpServletRequest) {
 		return SINGLETON;
 	}
 }

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DummyProfile.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DummyProfile.java?rev=1362405&r1=1362404&r2=1362405&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DummyProfile.java (original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/DummyProfile.java Tue Jul 17 08:27:09 2012
@@ -38,7 +38,7 @@ public class DummyProfile implements Pro
 	/**
 	 * @see javax.ccpp.Profile#getAttributes()
 	 */
-	@SuppressWarnings("unchecked")
+	@SuppressWarnings("rawtypes")
     public Set getAttributes() {
 		return null;
 	}
@@ -53,7 +53,7 @@ public class DummyProfile implements Pro
 	/**
 	 * @see javax.ccpp.Profile#getComponents()
 	 */
-	@SuppressWarnings("unchecked")
+    @SuppressWarnings("rawtypes")
     public Set getComponents() {
 		return null;
 	}

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/EventCoordinationServiceImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/EventCoordinationServiceImpl.java?rev=1362405&r1=1362404&r2=1362405&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/EventCoordinationServiceImpl.java (original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/EventCoordinationServiceImpl.java Tue Jul 17 08:27:09 2012
@@ -16,25 +16,181 @@
  */
 package org.apache.sling.portal.container.internal;
 
+import java.io.IOException;
+import java.util.LinkedHashSet;
 import java.util.List;
+import java.util.Set;
 
 import javax.portlet.Event;
+import javax.portlet.PortletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import javax.xml.namespace.QName;
 
 import org.apache.pluto.container.EventCoordinationService;
 import org.apache.pluto.container.PortletContainer;
+import org.apache.pluto.container.PortletContainerException;
 import org.apache.pluto.container.PortletWindow;
+import org.apache.pluto.container.om.portlet.EventDefinition;
+import org.apache.pluto.container.om.portlet.EventDefinitionReference;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.PortletDefinition;
+import org.apache.sling.portal.container.PortletRegistryService;
+import org.apache.sling.portal.container.SlingPortletConfig;
+import org.apache.sling.portal.container.SlingPortletContainer;
+import org.apache.sling.portal.container.SlingPortletWindow;
+import org.apache.sling.portal.container.internal.util.PortalUtil;
+import org.apache.sling.portal.container.spi.PortalEventCoordinatorService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class EventCoordinationServiceImpl implements EventCoordinationService {
+
+    /** The logger. */
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    /** Request attribute caching the portlet windows for this request. */
+    private static final String ATTR_WINDOWS = EventCoordinationServiceImpl.class.getName() + "/windows";
+
+    /** Request attribute for the recursive count. */
+    private static final String ATTR_RECURSIVE = EventCoordinationServiceImpl.class.getName() + "/recursive";
+
+    /** Max recursion depth. */
+    private static final Integer MAX_DEPTH = 15;
 
-public class EventCoordinationServiceImpl implements EventCoordinationService
-{
     /**
      * @see org.apache.pluto.container.EventCoordinationService#processEvents(org.apache.pluto.container.PortletContainer, org.apache.pluto.container.PortletWindow, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.util.List)
      */
-    public void processEvents(PortletContainer container,
-                              PortletWindow portletWindow, HttpServletRequest request,
-                              HttpServletResponse response, List<Event> events)
-    {
-        // we simply do nothing for now
+    @SuppressWarnings("unchecked")
+    public void processEvents(final PortletContainer container,
+                              final PortletWindow portletWindow,
+                              final HttpServletRequest request,
+                              final HttpServletResponse response,
+                              final List<Event> events) {
+        final SlingPortletContainer portletContainer = (SlingPortletContainer)container;
+
+        // get the list of relevant window - calculate this only once per request
+        final List<SlingPortletWindow> windows;
+        Object windowsObj = request.getAttribute(ATTR_WINDOWS);
+        if ( windowsObj != null ) {
+            windows = (List<SlingPortletWindow>)windowsObj;
+        } else {
+            final PortalEventCoordinatorService pecs = portletContainer.getPortalEventCoordinatorService();
+            windows = pecs.getPortletWindow(PortalUtil.getSlingHttpServletRequest(request));
+            request.setAttribute(ATTR_WINDOWS, windows);
+        }
+
+        final Integer depth = (Integer) request.getAttribute(ATTR_RECURSIVE);
+        if ( depth != null && depth.compareTo(MAX_DEPTH) == 0 ) {
+            logger.error("Max recursion depth of {} received for portlet event delivery.", MAX_DEPTH);
+            return;
+        }
+        try {
+            final int newDepth;
+            if ( depth == null ) {
+                newDepth = 1;
+            } else {
+                newDepth = depth + 1;
+            }
+            request.setAttribute(ATTR_RECURSIVE, newDepth);
+
+            final PortletRegistryService registry = portletContainer.getPortletRegistryService();
+
+            for (final Event event : events) {
+                final Set<SlingPortletWindow> receivers = this.getAllPortletsRegisteredForEvent(event, registry, windows);
+
+                for (final SlingPortletWindow receiver : receivers) {
+                    try {
+                        container.doEvent(receiver, request, response, event);
+                    } catch (final PortletException e) {
+                        logger.error("Unable to deliver event: " + e.getMessage(), e);
+                    } catch (final IOException e) {
+                        logger.error("Unable to deliver event: " + e.getMessage(), e);
+                    } catch (final PortletContainerException e) {
+                        logger.error("Unable to deliver event: " + e.getMessage(), e);
+                    }
+                }
+            }
+        } finally {
+            request.setAttribute(ATTR_RECURSIVE, depth);
+        }
+    }
+
+    private Set<SlingPortletWindow> getAllPortletsRegisteredForEvent(final Event event,
+        final PortletRegistryService registry,
+        final List<SlingPortletWindow> windows) {
+
+        final Set<SlingPortletWindow> resultSet = new LinkedHashSet<SlingPortletWindow>();
+
+        final QName eventName = event.getQName();
+
+        for (final SlingPortletWindow portlet : windows) {
+            final SlingPortletConfig config = portlet.getPortletEntity().getPortletConfig();
+            final PortletDefinition portletDD = config.getPortletDefinition();
+
+            final List<? extends EventDefinitionReference> processingEvents = portletDD.getSupportedProcessingEvents();
+            if (processingEvents != null) {
+                final String defaultNamespace = config.getPortletDefinition().getApplication().getDefaultNamespace();
+
+                if (isEventSupported(processingEvents, eventName, defaultNamespace)) {
+                    resultSet.add(portlet);
+                } else {
+                    for (final EventDefinitionReference ref : processingEvents) {
+                        final QName name = ref.getQualifiedName(defaultNamespace);
+                        if (name == null) {
+                            continue;
+                        }
+                        // add also grouped portlets, that ends with "."
+                        if (name.toString().endsWith(".")
+                            && eventName.toString().startsWith(name.toString())) {
+                            resultSet.add(portlet);
+                            break;
+                        }
+                        // also look for alias names:
+                        final List<QName> aliases = getAllAliases(eventName, config.getPortletDefinition().getApplication());
+                        if (aliases != null && aliases.contains(name) ) {
+                            resultSet.add(portlet);
+                            break;
+                        }
+                        // also look for default namespaced events
+                        if (name.getNamespaceURI() == null || name.getNamespaceURI().equals("")) {
+                            final QName qname = new QName(defaultNamespace, name.getLocalPart());
+                            if (eventName.toString().equals(qname.toString())) {
+                                resultSet.add(portlet);
+                                break;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        return resultSet;
+    }
+
+    private boolean isEventSupported(final List<? extends EventDefinitionReference> supportedEvents, final QName eventName, final String defaultNamespace) {
+        if (supportedEvents != null) {
+            for (EventDefinitionReference ref : supportedEvents) {
+                final QName refQName = ref.getQualifiedName(defaultNamespace);
+                if (refQName != null && refQName.equals(eventName)) {
+
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    private List<QName> getAllAliases(final QName eventName, final PortletApplicationDefinition portletAppDD) {
+        if (portletAppDD.getEventDefinitions() != null) {
+
+            for (final EventDefinition def : portletAppDD.getEventDefinitions()) {
+                final QName defQName = def.getQualifiedName(portletAppDD.getDefaultNamespace());
+                if (defQName != null && defQName.equals(eventName)){
+                    return def.getAliases();
+                }
+            }
+        }
+        return null;
     }
 }

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/EventProviderImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/EventProviderImpl.java?rev=1362405&r1=1362404&r2=1362405&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/EventProviderImpl.java (original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/EventProviderImpl.java Tue Jul 17 08:27:09 2012
@@ -23,38 +23,57 @@ import javax.portlet.Event;
 import javax.xml.namespace.QName;
 
 import org.apache.pluto.container.EventProvider;
-import org.apache.pluto.container.PortletWindow;
 import org.apache.pluto.container.om.portlet.EventDefinition;
 import org.apache.pluto.container.om.portlet.EventDefinitionReference;
 import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
-
+import org.apache.sling.portal.container.SlingPortletWindow;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * An event provider creates events for a specific portlet window.
+ */
 public class EventProviderImpl implements EventProvider {
 
-    private PortletWindow portletWindow;
+    /** Logger. */
+    private static final Logger LOGGER = LoggerFactory.getLogger(EventProviderImpl.class.getName());
+
+    /** The portlet window. */
+    private final SlingPortletWindow portletWindow;
 
-    public EventProviderImpl(PortletWindow portletWindow) {
+    /**
+     * Constructor
+     */
+    public EventProviderImpl(final SlingPortletWindow portletWindow) {
         this.portletWindow = portletWindow;
     }
 
     /**
      * @see org.apache.pluto.container.EventProvider#createEvent(javax.xml.namespace.QName, java.io.Serializable)
      */
-    public Event createEvent(QName qname, Serializable value) throws IllegalArgumentException {
+    public Event createEvent(final QName qname, final Serializable value) throws IllegalArgumentException {
         if (isDeclaredAsPublishingEvent(qname)) {
             if (value != null && !isValueInstanceOfDefinedClass(qname, value)) {
                 throw new IllegalArgumentException("Payload has not the right class");
             }
-            return new EventImpl(qname, value);
+        } else {
+            final String key = "event-provider-impl:" + qname.toString();
+            if ( portletWindow.getPortletEntity().getAttribute(key) == null ) {
+                LOGGER.warn("Portlet {} is sending undeclared events {} - value type is not checked!", portletWindow.getId().getStringId(), qname);
+                portletWindow.getPortletEntity().setAttribute(key, Boolean.TRUE);
+            }
         }
-        return null;
+        return new EventImpl(qname, value);
     }
 
-    private boolean isDeclaredAsPublishingEvent(QName qname) {
+    /**
+     * Check if the event is declared
+     */
+    private boolean isDeclaredAsPublishingEvent(final QName qname) {
         final List<? extends EventDefinitionReference> events = portletWindow.getPortletDefinition().getSupportedPublishingEvents();
         if (events != null) {
             final String defaultNamespace = portletWindow.getPortletDefinition().getApplication().getDefaultNamespace();
-            for (EventDefinitionReference ref : events)
-            {
+            for (EventDefinitionReference ref : events) {
                 final QName name = ref.getQualifiedName(defaultNamespace);
                 if (name == null) {
                     continue;
@@ -67,11 +86,14 @@ public class EventProviderImpl implement
         return false;
     }
 
+    /**
+     * Check if the value has the right type
+     */
     private boolean isValueInstanceOfDefinedClass(QName qname, Serializable value) {
         final PortletApplicationDefinition app = portletWindow.getPortletDefinition().getApplication();
-        List<? extends EventDefinition> events = app.getEventDefinitions();
+        final List<? extends EventDefinition> events = app.getEventDefinitions();
         if (events != null) {
-            for (EventDefinition def : events) {
+            for (final EventDefinition def : events) {
                 if (def.getQName() != null) {
                     if (def.getQName().equals(qname)) {
                         return value.getClass().getName().equals(def.getValueType());

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletActionResponseContextImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletActionResponseContextImpl.java?rev=1362405&r1=1362404&r2=1362405&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletActionResponseContextImpl.java (original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletActionResponseContextImpl.java Tue Jul 17 08:27:09 2012
@@ -23,46 +23,43 @@ import javax.servlet.http.HttpServletReq
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.pluto.container.PortletActionResponseContext;
-import org.apache.pluto.container.PortletWindow;
 import org.apache.sling.portal.container.SlingPortletContainer;
+import org.apache.sling.portal.container.SlingPortletWindow;
 import org.apache.sling.portal.container.internal.request.PortalRequestContext;
 import org.apache.sling.portal.container.internal.request.PortalURL;
 
 /**
- * @version $Id$
- *
+ * Portlet action response context.
  */
-public class PortletActionResponseContextImpl extends PortletStateAwareResponseContextImpl implements
-                PortletActionResponseContext
-{
+public class PortletActionResponseContextImpl
+    extends PortletStateAwareResponseContextImpl
+    implements PortletActionResponseContext {
+
     private boolean redirect;
     private String redirectLocation;
     private String renderURLParamName;
 
-    public PortletActionResponseContextImpl(SlingPortletContainer container, HttpServletRequest containerRequest,
-                                            HttpServletResponse containerResponse, PortletWindow window)
-    {
+    public PortletActionResponseContextImpl(final SlingPortletContainer container,
+                    final HttpServletRequest containerRequest,
+                    final HttpServletResponse containerResponse,
+                    final SlingPortletWindow window) {
         super(container, containerRequest, containerResponse, window);
     }
 
-    public String getResponseURL()
-    {
-        if (!isReleased())
-        {
-            close();
-            if (!redirect || renderURLParamName != null)
-            {
-                PortalURL url = PortalRequestContext.getContext().createPortalURL();
+    /**
+     * @see org.apache.pluto.container.PortletActionResponseContext#getResponseURL()
+     */
+    public String getResponseURL() {
+        if (!isReleased()) {
+            this.close();
+            if (!redirect || renderURLParamName != null) {
+                final PortalURL url = PortalRequestContext.getContext().createPortalURL();
                 url.setActionWindow(null);
-                if (redirect)
-                {
-                    try
-                    {
+                if (redirect) {
+                    try {
                         return redirectLocation + "?" + URLEncoder.encode(renderURLParamName, "UTF-8") + "=" + URLEncoder.encode(url.toURL(true), "UTF-8");
-                    }
-                    catch (UnsupportedEncodingException e)
-                    {
-                        // Cannot happen: UTF-8 is a buildin/required encoder
+                    } catch (final UnsupportedEncodingException e) {
+                        // Cannot happen: UTF-8 is a builtin/required encoder
                         return null;
                     }
                 }
@@ -73,20 +70,25 @@ public class PortletActionResponseContex
         return null;
     }
 
-    public boolean isRedirect()
-    {
+    /**
+     * @see org.apache.pluto.container.PortletActionResponseContext#isRedirect()
+     */
+    public boolean isRedirect() {
         return redirect;
     }
 
-    public void setRedirect(String location)
-    {
+    /**
+     * @see org.apache.pluto.container.PortletActionResponseContext#setRedirect(java.lang.String)
+     */
+    public void setRedirect(final String location) {
         setRedirect(location, null);
     }
 
-    public void setRedirect(String location, String renderURLParamName)
-    {
-        if (!isClosed())
-        {
+    /**
+     * @see org.apache.pluto.container.PortletActionResponseContext#setRedirect(java.lang.String, java.lang.String)
+     */
+    public void setRedirect(final String location, final String renderURLParamName) {
+        if (!isClosed()) {
             this.redirectLocation = location;
             this.renderURLParamName = renderURLParamName;
             this.redirect = true;

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletContainerImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletContainerImpl.java?rev=1362405&r1=1362404&r2=1362405&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletContainerImpl.java (original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletContainerImpl.java Tue Jul 17 08:27:09 2012
@@ -22,6 +22,7 @@ import org.apache.sling.portal.container
 import org.apache.sling.portal.container.PortletWindowManager;
 import org.apache.sling.portal.container.SlingPortletContainer;
 import org.apache.sling.portal.container.api.PortletApplicationRegistry;
+import org.apache.sling.portal.container.spi.PortalEventCoordinatorService;
 
 /**
  *  This is the portlet container implementation based on the Pluto default
@@ -77,4 +78,11 @@ public class PortletContainerImpl
     public PortletRegistryService getPortletRegistryService() {
         return this.registry;
     }
+
+    /**
+     * @see org.apache.sling.portal.container.SlingPortletContainer#getPortalEventCoordinatorService()
+     */
+    public PortalEventCoordinatorService getPortalEventCoordinatorService() {
+        return ((ContainerServicesImpl)this.getContainerServices()).getPortalEventCoordinatorService();
+    }
 }

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletEventResponseContextImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletEventResponseContextImpl.java?rev=1362405&r1=1362404&r2=1362405&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletEventResponseContextImpl.java (original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletEventResponseContextImpl.java Tue Jul 17 08:27:09 2012
@@ -20,20 +20,21 @@ import javax.servlet.http.HttpServletReq
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.pluto.container.PortletEventResponseContext;
-import org.apache.pluto.container.PortletWindow;
 import org.apache.sling.portal.container.SlingPortletContainer;
+import org.apache.sling.portal.container.SlingPortletWindow;
 
 /**
- * @version $Id$
+ * Event response context
  *
  */
-public class PortletEventResponseContextImpl extends PortletStateAwareResponseContextImpl implements
-                PortletEventResponseContext
-{
+public class PortletEventResponseContextImpl
+    extends PortletStateAwareResponseContextImpl
+    implements PortletEventResponseContext {
 
-    public PortletEventResponseContextImpl(SlingPortletContainer container, HttpServletRequest containerRequest,
-                                           HttpServletResponse containerResponse, PortletWindow window)
-    {
+    public PortletEventResponseContextImpl(final SlingPortletContainer container,
+                                           final HttpServletRequest containerRequest,
+                                           final HttpServletResponse containerResponse,
+                                           final SlingPortletWindow window) {
         super(container, containerRequest, containerResponse, window);
     }
 }

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletMimeResponseContextImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletMimeResponseContextImpl.java?rev=1362405&r1=1362404&r2=1362405&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletMimeResponseContextImpl.java (original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletMimeResponseContextImpl.java Tue Jul 17 08:27:09 2012
@@ -27,10 +27,10 @@ import javax.servlet.http.HttpServletRes
 
 import org.apache.pluto.container.PortletMimeResponseContext;
 import org.apache.pluto.container.PortletURLProvider;
-import org.apache.pluto.container.PortletWindow;
 import org.apache.pluto.container.PortletURLProvider.TYPE;
 import org.apache.pluto.container.util.PrintWriterServletOutputStream;
 import org.apache.sling.portal.container.SlingPortletContainer;
+import org.apache.sling.portal.container.SlingPortletWindow;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -88,27 +88,41 @@ public abstract class PortletMimeRespons
     private CacheControl cacheControl;
     private OutputStream outputStream;
 
-    public PortletMimeResponseContextImpl(SlingPortletContainer container, HttpServletRequest containerRequest,
-                                          HttpServletResponse containerResponse, PortletWindow window) {
+    public PortletMimeResponseContextImpl(final SlingPortletContainer container,
+                    final HttpServletRequest containerRequest,
+                    final HttpServletResponse containerResponse,
+                    final SlingPortletWindow window) {
         super(container, containerRequest, containerResponse, window);
     }
 
+    /**
+     * @see org.apache.sling.portal.container.internal.PortletResponseContextImpl#close()
+     */
     public void close() {
-        cacheControl = null;
-        outputStream = null;
+        this.cacheControl = null;
+        this.outputStream = null;
         super.close();
     }
 
+    /**
+     * @see org.apache.pluto.container.PortletMimeResponseContext#flushBuffer()
+     */
     public void flushBuffer() throws IOException {
         if (!isClosed()) {
             getServletResponse().flushBuffer();
         }
     }
 
+    /**
+     * @see org.apache.pluto.container.PortletMimeResponseContext#getBufferSize()
+     */
     public int getBufferSize() {
         return getServletResponse().getBufferSize();
     }
 
+    /**
+     * @see org.apache.pluto.container.PortletMimeResponseContext#getCacheControl()
+     */
     public CacheControl getCacheControl() {
         if (isClosed()) {
             return null;
@@ -119,18 +133,30 @@ public abstract class PortletMimeRespons
         return cacheControl;
     }
 
+    /**
+     * @see org.apache.pluto.container.PortletMimeResponseContext#getCharacterEncoding()
+     */
     public String getCharacterEncoding() {
         return isClosed() ? null : getServletResponse().getCharacterEncoding();
     }
 
+    /**
+     * @see org.apache.pluto.container.PortletMimeResponseContext#getContentType()
+     */
     public String getContentType() {
         return isClosed() ? null : getServletResponse().getContentType();
     }
 
+    /**
+     * @see org.apache.pluto.container.PortletMimeResponseContext#getLocale()
+     */
     public Locale getLocale() {
         return isClosed() ? null : getServletResponse().getLocale();
     }
 
+    /**
+     * @see org.apache.pluto.container.PortletMimeResponseContext#getOutputStream()
+     */
     public OutputStream getOutputStream() throws IOException, IllegalStateException {
         if (isClosed()) {
             return null;
@@ -148,36 +174,57 @@ public abstract class PortletMimeRespons
         return new SecureOutputStream(outputStream);
     }
 
+    /**
+     * @see org.apache.pluto.container.PortletMimeResponseContext#getWriter()
+     */
     public PrintWriter getWriter() throws IOException, IllegalStateException {
         return isClosed() ? null : new SecurePrinterWriter(getServletResponse().getWriter());
     }
 
+    /**
+     * @see org.apache.pluto.container.PortletMimeResponseContext#isCommitted()
+     */
     public boolean isCommitted() {
         return getServletResponse().isCommitted();
     }
 
+    /**
+     * @see org.apache.pluto.container.PortletMimeResponseContext#reset()
+     */
     public void reset() {
         getServletResponse().reset();
     }
 
+    /**
+     * @see org.apache.pluto.container.PortletMimeResponseContext#resetBuffer()
+     */
     public void resetBuffer() {
         if (!isClosed()) {
             getServletResponse().resetBuffer();
         }
     }
 
+    /**
+     * @see org.apache.pluto.container.PortletMimeResponseContext#setBufferSize(int)
+     */
     public void setBufferSize(int size) {
         if (!isClosed()) {
             getServletResponse().setBufferSize(size);
         }
     }
 
+    /**
+     * @see org.apache.pluto.container.PortletMimeResponseContext#setContentType(java.lang.String)
+     */
     public void setContentType(String contentType) {
         if (!isClosed()) {
             getServletResponse().setContentType(contentType);
         }
     }
 
+    /**
+     * @see org.apache.pluto.container.PortletMimeResponseContext#getPortletURLProvider(org.apache.pluto.container.PortletURLProvider.TYPE)
+     */
     public PortletURLProvider getPortletURLProvider(TYPE type) {
         return isClosed() ? null : new PortletURLProviderImpl(getPortalURL(), type, getPortletWindow());
     }

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletRenderResponseContextImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletRenderResponseContextImpl.java?rev=1362405&r1=1362404&r2=1362405&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletRenderResponseContextImpl.java (original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletRenderResponseContextImpl.java Tue Jul 17 08:27:09 2012
@@ -30,7 +30,6 @@ import javax.servlet.http.HttpServletReq
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.pluto.container.PortletRenderResponseContext;
-import org.apache.pluto.container.PortletWindow;
 import org.apache.pluto.container.om.portlet.DisplayName;
 import org.apache.pluto.container.om.portlet.PortletDefinition;
 import org.apache.pluto.container.om.portlet.Supports;
@@ -56,10 +55,10 @@ public class PortletRenderResponseContex
 
     private final boolean writeTitle;
 
-    public PortletRenderResponseContextImpl(SlingPortletContainer container,
-                                            HttpServletRequest containerRequest,
-                                            HttpServletResponse containerResponse,
-                                            PortletWindow window) {
+    public PortletRenderResponseContextImpl(final SlingPortletContainer container,
+                    final HttpServletRequest containerRequest,
+                    final HttpServletResponse containerResponse,
+                    final SlingPortletWindow window) {
         super(container, containerRequest, containerResponse, window);
         final PortletDefinition def = window.getPortletDefinition();
         DisplayName dn = def.getDisplayName(containerRequest.getLocale());
@@ -71,10 +70,10 @@ public class PortletRenderResponseContex
             } else if ( def.getPortletInfo().getShortTitle() != null ) {
                 this.title = def.getPortletInfo().getShortTitle();
             } else {
-                this.title = ((SlingPortletWindow)window).getPortletEntity().getPortletEntityId().getKey();
+                this.title = window.getPortletEntity().getPortletEntityId().getKey();
             }
         }
-        this.writeTitle = !((SlingPortletWindow)window).getConfiguration().get("hideTitleBar", false);
+        this.writeTitle = !window.getConfiguration().get("hideTitleBar", false);
     }
 
     private boolean written() {

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletRequestContextServiceImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletRequestContextServiceImpl.java?rev=1362405&r1=1362404&r2=1362405&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletRequestContextServiceImpl.java (original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletRequestContextServiceImpl.java Tue Jul 17 08:27:09 2012
@@ -29,6 +29,7 @@ import org.apache.pluto.container.Portle
 import org.apache.pluto.container.PortletResourceResponseContext;
 import org.apache.pluto.container.PortletWindow;
 import org.apache.sling.portal.container.SlingPortletContainer;
+import org.apache.sling.portal.container.SlingPortletWindow;
 
 /**
  * Default implementation of the portlet request context service.
@@ -45,7 +46,7 @@ public class PortletRequestContextServic
                                                                         HttpServletResponse containerResponse,
                                                                         PortletWindow window)
     {
-        return new PortletActionResponseContextImpl((SlingPortletContainer)container, containerRequest, containerResponse, window);
+        return new PortletActionResponseContextImpl((SlingPortletContainer)container, containerRequest, containerResponse, (SlingPortletWindow)window);
     }
 
     public PortletRequestContext getPortletEventRequestContext(PortletContainer container, HttpServletRequest containerRequest,
@@ -58,7 +59,7 @@ public class PortletRequestContextServic
                                                                       HttpServletRequest containerRequest,
                                                                       HttpServletResponse containerResponse, PortletWindow window)
     {
-        return new PortletEventResponseContextImpl((SlingPortletContainer)container, containerRequest, containerResponse, window);
+        return new PortletEventResponseContextImpl((SlingPortletContainer)container, containerRequest, containerResponse, (SlingPortletWindow)window);
     }
 
     public PortletRequestContext getPortletRenderRequestContext(PortletContainer container, HttpServletRequest containerRequest,
@@ -72,7 +73,7 @@ public class PortletRequestContextServic
                                                                         HttpServletResponse containerResponse,
                                                                         PortletWindow window)
     {
-        return new PortletRenderResponseContextImpl((SlingPortletContainer)container, containerRequest, containerResponse, window);
+        return new PortletRenderResponseContextImpl((SlingPortletContainer)container, containerRequest, containerResponse, (SlingPortletWindow)window);
     }
 
     public PortletResourceRequestContext getPortletResourceRequestContext(PortletContainer container,
@@ -88,6 +89,6 @@ public class PortletRequestContextServic
                                                                             HttpServletResponse containerResponse,
                                                                             PortletWindow window)
     {
-        return new PortletResourceResponseContextImpl((SlingPortletContainer)container, containerRequest, containerResponse, window);
+        return new PortletResourceResponseContextImpl((SlingPortletContainer)container, containerRequest, containerResponse, (SlingPortletWindow)window);
     }
 }

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletResourceResponseContextImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletResourceResponseContextImpl.java?rev=1362405&r1=1362404&r2=1362405&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletResourceResponseContextImpl.java (original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletResourceResponseContextImpl.java Tue Jul 17 08:27:09 2012
@@ -22,8 +22,8 @@ import javax.servlet.http.HttpServletReq
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.pluto.container.PortletResourceResponseContext;
-import org.apache.pluto.container.PortletWindow;
 import org.apache.sling.portal.container.SlingPortletContainer;
+import org.apache.sling.portal.container.SlingPortletWindow;
 
 /**
  * @version $Id$
@@ -33,8 +33,10 @@ public class PortletResourceResponseCont
                 PortletResourceResponseContext
 {
 
-    public PortletResourceResponseContextImpl(SlingPortletContainer container, HttpServletRequest containerRequest,
-                                              HttpServletResponse containerResponse, PortletWindow window)
+    public PortletResourceResponseContextImpl(final SlingPortletContainer container,
+                    final HttpServletRequest containerRequest,
+                    final HttpServletResponse containerResponse,
+                    final SlingPortletWindow window)
     {
         super(container, containerRequest, containerResponse, window);
     }

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletResponseContextImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletResponseContextImpl.java?rev=1362405&r1=1362404&r2=1362405&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletResponseContextImpl.java (original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletResponseContextImpl.java Tue Jul 17 08:27:09 2012
@@ -28,6 +28,7 @@ import org.apache.pluto.container.Portle
 import org.apache.pluto.container.PortletWindow;
 import org.apache.pluto.container.ResourceURLProvider;
 import org.apache.sling.portal.container.SlingPortletContainer;
+import org.apache.sling.portal.container.SlingPortletWindow;
 import org.apache.sling.portal.container.internal.request.PortalRequestContext;
 import org.apache.sling.portal.container.internal.request.PortalURL;
 import org.w3c.dom.DOMException;
@@ -35,8 +36,7 @@ import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
 /**
- * @version $Id$
- *
+ * Base class for all response contexts.
  */
 public abstract class PortletResponseContextImpl
     implements PortletResponseContext {
@@ -57,7 +57,7 @@ public abstract class PortletResponseCon
     private HttpServletResponse servletResponse;
 
     /** The portlet window */
-    private PortletWindow window;
+    private SlingPortletWindow window;
 
     /** The portal url */
     private PortalURL portalURL;
@@ -70,15 +70,11 @@ public abstract class PortletResponseCon
 
     /**
      * Constrcutor
-     * @param container
-     * @param containerRequest
-     * @param containerResponse
-     * @param window
-     */
-    public PortletResponseContextImpl(SlingPortletContainer container,
-                                      HttpServletRequest containerRequest,
-                                      HttpServletResponse containerResponse,
-                                      PortletWindow window) {
+     */
+    public PortletResponseContextImpl(final SlingPortletContainer container,
+                                      final HttpServletRequest containerRequest,
+                                      final HttpServletResponse containerResponse,
+                                      final SlingPortletWindow window) {
         this.container = container;
         this.containerRequest = containerRequest;
         this.containerResponse = containerResponse;
@@ -88,7 +84,6 @@ public abstract class PortletResponseCon
 
     /**
      * Get the portal url
-     * @return
      */
     protected PortalURL getPortalURL() {
         return portalURL;
@@ -111,7 +106,7 @@ public abstract class PortletResponseCon
     /**
      * @see org.apache.pluto.container.PortletResponseContext#init(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
      */
-    public void init(HttpServletRequest servletRequest, HttpServletResponse servletResponse) {
+    public void init(final HttpServletRequest servletRequest, final HttpServletResponse servletResponse) {
         this.servletRequest = servletRequest;
         this.servletResponse = servletResponse;
     }
@@ -119,7 +114,7 @@ public abstract class PortletResponseCon
     /**
      * @see org.apache.pluto.container.PortletResponseContext#createElement(java.lang.String)
      */
-    public Element createElement(String tagName) throws DOMException {
+    public Element createElement(final String tagName) throws DOMException {
         DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
         DocumentBuilder docBuilder;
 
@@ -135,7 +130,7 @@ public abstract class PortletResponseCon
     /**
      * @see org.apache.pluto.container.PortletResponseContext#addProperty(javax.servlet.http.Cookie)
      */
-    public void addProperty(Cookie cookie) {
+    public void addProperty(final Cookie cookie) {
         if (!isClosed()) {
             servletResponse.addCookie(cookie);
         }
@@ -144,14 +139,14 @@ public abstract class PortletResponseCon
     /**
      * @see org.apache.pluto.container.PortletResponseContext#addProperty(java.lang.String, org.w3c.dom.Element)
      */
-    public void addProperty(String key, Element element) {
+    public void addProperty(final String key, final Element element) {
         // not supported
     }
 
     /**
      * @see org.apache.pluto.container.PortletResponseContext#addProperty(java.lang.String, java.lang.String)
      */
-    public void addProperty(String key, String value) {
+    public void addProperty(final String key, final String value) {
         // not supported
     }
 
@@ -229,7 +224,7 @@ public abstract class PortletResponseCon
     /**
      * @see org.apache.pluto.container.PortletResponseContext#setProperty(java.lang.String, java.lang.String)
      */
-    public void setProperty(String key, String value) {
+    public void setProperty(final String key, final String value) {
         // not supported
     }
 
@@ -237,6 +232,6 @@ public abstract class PortletResponseCon
      * @see org.apache.pluto.container.PortletResponseContext#getResourceURLProvider()
      */
     public ResourceURLProvider getResourceURLProvider() {
-        return isReleased() ? null : new ResourceURLProviderImpl(servletRequest,window);
+        return isReleased() ? null : new ResourceURLProviderImpl(servletRequest, window);
     }
 }

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletStateAwareResponseContextImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletStateAwareResponseContextImpl.java?rev=1362405&r1=1362404&r2=1362405&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletStateAwareResponseContextImpl.java (original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/PortletStateAwareResponseContextImpl.java Tue Jul 17 08:27:09 2012
@@ -29,105 +29,115 @@ import javax.servlet.http.HttpServletRes
 import org.apache.pluto.container.EventProvider;
 import org.apache.pluto.container.PortletStateAwareResponseContext;
 import org.apache.pluto.container.PortletURLProvider;
-import org.apache.pluto.container.PortletWindow;
 import org.apache.pluto.container.impl.PortletURLImpl;
 import org.apache.sling.portal.container.SlingPortletContainer;
+import org.apache.sling.portal.container.SlingPortletWindow;
 import org.apache.sling.portal.container.internal.request.PortalRequestContext;
 import org.apache.sling.portal.container.internal.request.PortalURL;
 
 /**
- * @version $Id$
- *
+ * The context for state aware responses.
  */
-public abstract class PortletStateAwareResponseContextImpl extends PortletResponseContextImpl implements
-                PortletStateAwareResponseContext
-{
+public abstract class PortletStateAwareResponseContextImpl
+    extends PortletResponseContextImpl
+    implements PortletStateAwareResponseContext {
+
     private List<Event> events;
+
     private PortletURLProviderImpl portletURLProvider;
 
-    public PortletStateAwareResponseContextImpl(SlingPortletContainer container, HttpServletRequest containerRequest,
-                                                HttpServletResponse containerResponse, PortletWindow window)
-    {
+    public PortletStateAwareResponseContextImpl(final SlingPortletContainer container,
+                    final HttpServletRequest containerRequest,
+                    final HttpServletResponse containerResponse,
+                    final SlingPortletWindow window) {
         super(container, containerRequest, containerResponse, window);
         this.portletURLProvider = new PortletURLProviderImpl(getPortalURL(), PortletURLProvider.TYPE.RENDER, window);
     }
 
-    protected PortletURLProvider getPorletURLProvider()
-    {
-        return portletURLProvider;
-    }
-
-    @Override
-    public void close()
-    {
-        if (!isClosed())
-        {
+    /**
+     * @see org.apache.sling.portal.container.internal.PortletResponseContextImpl#close()
+     */
+    public void close() {
+        if (!isClosed()) {
             super.close();
             new PortletURLImpl(this, portletURLProvider).filterURL();
-            PortalURL url = portletURLProvider.apply();
+            final PortalURL url = portletURLProvider.apply();
             PortalRequestContext.getContext().mergePortalURL(url, getPortletWindow().getId().getStringId());
         }
     }
 
-    @Override
-    public void release()
-    {
-        events = null;
-        portletURLProvider = null;
+    /**
+     * @see org.apache.sling.portal.container.internal.PortletResponseContextImpl#release()
+     */
+    public void release() {
+        this.events = null;
+        this.portletURLProvider = null;
         super.release();
     }
 
-    public List<Event> getEvents()
-    {
-        if (isReleased())
-        {
+    /**
+     * @see org.apache.pluto.container.PortletStateAwareResponseContext#getEvents()
+     */
+    public List<Event> getEvents() {
+        if (isReleased()) {
             return null;
         }
-        if (events == null)
-        {
+        if (events == null) {
             events = new ArrayList<Event>();
         }
         return events;
     }
 
-    public PortletMode getPortletMode()
-    {
+    /**
+     * @see org.apache.pluto.container.PortletStateAwareResponseContext#getPortletMode()
+     */
+    public PortletMode getPortletMode() {
         return isClosed() ? null : portletURLProvider.getPortletMode();
     }
 
-    public Map<String, String[]> getPublicRenderParameters()
-    {
+    /**
+     * @see org.apache.pluto.container.PortletStateAwareResponseContext#getPublicRenderParameters()
+     */
+    public Map<String, String[]> getPublicRenderParameters() {
         return isClosed() ? null : portletURLProvider.getPublicRenderParameters();
     }
 
-    public Map<String, String[]> getRenderParameters()
-    {
+    /**
+     * @see org.apache.pluto.container.PortletStateAwareResponseContext#getRenderParameters()
+     */
+    public Map<String, String[]> getRenderParameters() {
         return isClosed() ? null : portletURLProvider.getRenderParameters();
     }
 
-    public WindowState getWindowState()
-    {
+    /**
+     * @see org.apache.pluto.container.PortletStateAwareResponseContext#getWindowState()
+     */
+    public WindowState getWindowState() {
         return isClosed() ? null : portletURLProvider.getWindowState();
     }
 
-    public void setPortletMode(PortletMode portletMode)
-    {
-        if (!isClosed())
-        {
+    /**
+     * @see org.apache.pluto.container.PortletStateAwareResponseContext#setPortletMode(javax.portlet.PortletMode)
+     */
+    public void setPortletMode(final PortletMode portletMode) {
+        if (!isClosed()) {
             portletURLProvider.setPortletMode(portletMode);
         }
     }
 
-    public void setWindowState(WindowState windowState)
-    {
-        if (!isClosed())
-        {
+    /**
+     * @see org.apache.pluto.container.PortletStateAwareResponseContext#setWindowState(javax.portlet.WindowState)
+     */
+    public void setWindowState(final WindowState windowState) {
+        if (!isClosed()) {
             portletURLProvider.setWindowState(windowState);
         }
     }
 
-    public EventProvider getEventProvider()
-    {
-        return isClosed() ? null : new EventProviderImpl(getPortletWindow());
+    /**
+     * @see org.apache.pluto.container.PortletStateAwareResponseContext#getEventProvider()
+     */
+    public EventProvider getEventProvider() {
+        return isClosed() ? null : new EventProviderImpl((SlingPortletWindow)getPortletWindow());
     }
 }

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/impl/DefaultPortalURLFactory.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/impl/DefaultPortalURLFactory.java?rev=1362405&r1=1362404&r2=1362405&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/impl/DefaultPortalURLFactory.java (original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/impl/DefaultPortalURLFactory.java Tue Jul 17 08:27:09 2012
@@ -26,16 +26,16 @@ import javax.portlet.PortletMode;
 import javax.portlet.WindowState;
 import javax.servlet.http.HttpServletRequest;
 
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.portal.container.internal.request.PortalURL;
 import org.apache.sling.portal.container.internal.request.PortalURLFactory;
 import org.apache.sling.portal.container.internal.request.PortalURLParameter;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-/**
- * @scr.component metatype="no"
- * @scr.service interface="PortalURLFactory"
- */
+@Component
+@Service(value=PortalURLFactory.class)
 public class DefaultPortalURLFactory implements PortalURLFactory {
 
 	/** Logger. */
@@ -56,7 +56,7 @@ public class DefaultPortalURLFactory imp
     /**
      * @see org.apache.sling.portal.container.internal.request.PortalURLFactory#parse(javax.servlet.http.HttpServletRequest)
      */
-    public PortalURL parse(HttpServletRequest request) {
+    public PortalURL parse(final HttpServletRequest request) {
         LOGGER.debug("Parsing URL: {}", request.getRequestURI());
 
         // Construct portal URL using info retrieved from servlet request.

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/impl/PortletWindowIDImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/impl/PortletWindowIDImpl.java?rev=1362405&r1=1362404&r2=1362405&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/impl/PortletWindowIDImpl.java (original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/impl/PortletWindowIDImpl.java Tue Jul 17 08:27:09 2012
@@ -68,6 +68,11 @@ public class PortletWindowIDImpl impleme
         return stringId.hashCode();
     }
 
+    @Override
+    public String toString() {
+        return "PortletWindowIDImpl [stringId=" + stringId + "]";
+    }
+
     /**
      * @see org.apache.sling.portal.container.SlingPortletWindowId#getPortletEntityId()
      */



Mime
View raw message