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 uk...@apache.org on 2007/07/26 11:05:40 UTC

svn commit: r559761 [3/3] - in /portals/pluto/branches/1.1-286-COMPATIBILITY: ./ pluto-container/src/main/java/org/apache/pluto/core/ pluto-container/src/main/java/org/apache/pluto/internal/impl/ pluto-container/src/main/java/org/apache/pluto/wrappers/...

Added: portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/PortletResponseWrapper.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/PortletResponseWrapper.java?view=auto&rev=559761
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/PortletResponseWrapper.java (added)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/PortletResponseWrapper.java Thu Jul 26 02:05:35 2007
@@ -0,0 +1,168 @@
+/*  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.
+ */
+/*
+ * NOTE: this source code is based on an early draft version of JSR 286 and not intended for product
+ * implementations. This file may change or vanish in the final version of the JSR 286 specification.
+ */
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+/*
+ * Copyright 2006 IBM Corporation.
+ *
+ */
+package javax.portlet.filter;
+
+import javax.portlet.PortletResponse;
+import javax.portlet.PortletURL;
+import javax.portlet.ResourceURL;
+import javax.servlet.http.Cookie;
+
+/**
+ * The <code>PortletResponseWrapper</code> provides a convenient 
+ * implementation of the <code>PortletResponse</code> interface 
+ * and is extended by other response wrappers.
+ * This class implements the Wrapper or Decorator pattern. 
+ * Methods default to calling through to the wrapped response object.
+ *
+ * @since 2.0
+ * @see PortletResponse
+ */
+public class PortletResponseWrapper implements PortletResponse {
+
+	   PortletResponse response;
+	    
+	    /** 
+	     * Require having a response for constructing
+	     * the wrapper.
+	     *
+	     */
+	    private PortletResponseWrapper() {
+	    }
+	    
+	    /**
+	     * Creates an <code>ActionResponse</code> adaptor 
+	     * wrapping the given response object.
+	     * 
+	     * @param response  the action response to wrap
+	     * @throws java.lang.IllegalArgumentException if the response is <code>null</code>
+	     */
+	    public PortletResponseWrapper(PortletResponse response) {
+	    	if ( response == null)
+	    		throw new java.lang.IllegalArgumentException("Response is null");
+
+	        this.response = response;
+	    }
+
+	    /**
+	     * The default behavior of this method is to call 
+	     * <code>addProperty(key, value)</code> on the wrapped response object.
+	     */
+	    public void addProperty(String key, String value) {
+	        response.addProperty(key, value);
+	    }
+
+	    /**
+	     * The default behavior of this method is to call 
+	     * <code>createActionURL()</code> on the wrapped response object.
+	     */
+	    public PortletURL createActionURL() {
+	        return response.createActionURL();
+	    }
+
+	    /**
+	     * The default behavior of this method is to call 
+	     * <code>createRenderURL()</code> on the wrapped response object.
+	     */
+	    public PortletURL createRenderURL() {
+	        return response.createRenderURL();
+	    }
+
+	    /**
+	     * The default behavior of this method is to call 
+	     * <code>createResourceURL</code> on the wrapped response object.
+	     */
+	    public ResourceURL createResourceURL() {
+	        return response.createResourceURL();
+	    }
+
+	    /**
+	     * The default behavior of this method is to call 
+	     * <code>encodeURL(path)</code> on the wrapped response object.
+	     */
+	    public String encodeURL(String path) {
+	        return response.encodeURL(path);
+	    }
+
+	    /**
+	     * The default behavior of this method is to call 
+	     * <code>getNamespace()</code> on the wrapped response object.
+	     */
+	    public String getNamespace() {
+	        return response.getNamespace();
+	    }
+
+	    /**
+	     * The default behavior of this method is to call 
+	     * <code>setProperty(key, value)</code> on the wrapped response object.
+	     */
+	    public void setProperty(String key, String value) {
+	        response.setProperty(key, value);
+	    }
+
+	    /**
+	     * Return the wrapped response object.
+	     * 
+	     * @return the wrapped response
+	     */
+	    public PortletResponse getResponse() {
+	        return response;
+	    }
+
+	    /**
+	     * Sets the response object being wrapped.
+	     * 
+	     * @param response the response to set
+	     * @throws java.lang.IllegalArgumentException   if the response is null.
+	     */
+	    public void setResponse(PortletResponse response) {
+	    	if ( response == null)
+	    		throw new java.lang.IllegalArgumentException("Response is null");
+
+	        this.response = response;
+	    }
+
+	    /**
+	     *  The default behavior of this method is to call 
+	     * <code>addProperty()</code> on the wrapped response object.
+	     */
+	    public void addProperty(Cookie cookie) {
+	        response.addProperty(cookie);
+	    }
+
+	    /**
+	     *  The default behavior of this method is to call 
+	     * <code>addProperty()</code> on the wrapped response object.
+	     */
+	    public void addProperty(String key, org.w3c.dom.Element element) {
+	        response.addProperty(key, element);
+	    }
+
+}

Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/RenderFilter.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/RenderFilter.java?view=diff&rev=559761&r1=559760&r2=559761
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/RenderFilter.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/RenderFilter.java Thu Jul 26 02:05:35 2007
@@ -51,28 +51,9 @@
  * 
  * @since 2.0
  */
-public interface RenderFilter {
+public interface RenderFilter extends PortletFilter {
 
     /**
-     * Called by the portlet container to indicate to a filter
-     * that it is being placed into service. The portlet container 
-     * calls the init method exactly once after instantiating the filter. 
-     * The init method must complete successfully before the filter 
-     * is asked to do any filtering work.
-     * <p>
-     * The portlet container cannot place the filter into service if the init method either
-     * <ul>
-     *   <li>throws a PortletException</li>
-     *   <li>does not return within a time period defined by the portlet container</li>
-     * </ul>
-     * 
-     * @param filterConfig    the filter configuration data defined 
-     *                        in the portlet deployment descriptor
-     * @throws PortletException  if an error occurs in the filter intialization
-     */
-    public void init(FilterConfig filterConfig) throws PortletException;
-    
-    /**
      * The <code>doFilter</code> method of the Filter is called by the 
      * portlet container each time a render request/response pair is passed 
      * through the chain due to a client request for a portlet method 
@@ -132,21 +113,5 @@
     public void doFilter(RenderRequest request, RenderResponse response,
                          FilterChain chain)
      throws IOException, PortletException;
-    
-    /**
-     * Called by the portlet container to indicate to a filter that it is 
-     * being taken out of service. This method is only called once all threads 
-     * within the filter's <code>doFilter</code> method have exited or 
-     * after a timeout period has passed. 
-     * <p>
-     * After the portlet container calls this method, it will not call the 
-     * <code>doFilter</code> method again on this instance of the filter.
-     * <p>
-     * This method gives the filter an opportunity to clean up any resources 
-     * that are being held (for example, memory, file handles, threads) and 
-     * make sure that any persistent state is synchronized with the 
-     * filter's current state in memory.
-     */
-    public void destroy();
-    
+        
 }

Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/RenderRequestWrapper.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/RenderRequestWrapper.java?view=diff&rev=559761&r1=559760&r2=559761
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/RenderRequestWrapper.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/RenderRequestWrapper.java Thu Jul 26 02:05:35 2007
@@ -30,18 +30,7 @@
  */
 package javax.portlet.filter;
 
-import java.security.Principal;
-import java.util.Enumeration;
-import java.util.Locale;
-import java.util.Map;
-
-import javax.portlet.PortalContext;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletPreferences;
-import javax.portlet.PortletSession;
 import javax.portlet.RenderRequest;
-import javax.portlet.WindowState;
-import javax.servlet.http.Cookie;
 
 /**
  * The <code>RenderRequestWrapper</code> provides a convenient 
@@ -53,18 +42,10 @@
  * @since 2.0
  * @see RenderRequest
  */
-public class RenderRequestWrapper implements RenderRequest {
+public class RenderRequestWrapper extends PortletRequestWrapper implements RenderRequest {
 
     RenderRequest request;
     
-    /** 
-     * Require having a request for constructing
-     * the wrapper.
-     *
-     */
-    private RenderRequestWrapper() {
-    }
-    
     /**
      * Creates an <code>RenderRequest</code> adaptor 
      * wrapping the given request object.
@@ -73,288 +54,11 @@
      * @throws java.lang.IllegalArgumentException if the request is <code>null</code>
      */
     public RenderRequestWrapper(RenderRequest request) {
-        this.request = request;
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getAttribute(String name)</code> on the wrapped request object.
-     */
-    public Object getAttribute(String name) {
-        return request.getAttribute(name);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getAttributeNames()</code> on the wrapped request object.
-     */
-    public Enumeration<String> getAttributeNames() {
-        return request.getAttributeNames();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getAuthType()</code> on the wrapped request object.
-     */
-    public String getAuthType() {
-        return request.getAuthType();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getContextPath()</code> on the wrapped request object.
-     */
-    public String getContextPath() {
-        return request.getContextPath();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getLocale()</code> on the wrapped request object.
-     */
-    public Locale getLocale() {
-        return request.getLocale();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getLocales()</code> on the wrapped request object.
-     */
-    public Enumeration getLocales() {
-        return request.getLocales();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getParameter(String name)</code> on the wrapped request object.
-     */
-    public String getParameter(String name) {
-        return request.getParameter(name);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getParameterMap()</code> on the wrapped request object.
-     */
-    public Map<String, String[]> getParameterMap() {
-        return request.getParameterMap();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getParameterNames()</code> on the wrapped request object.
-     */
-    public Enumeration<String> getParameterNames() {
-        return request.getParameterNames();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getParameterValues(name)</code> on the wrapped request object.
-     */
-    public String[] getParameterValues(String name) {
-        return request.getParameterValues(name);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getPortalContext()</code> on the wrapped request object.
-     */
-    public PortalContext getPortalContext() {
-        return request.getPortalContext();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getPortletMode()</code> on the wrapped request object.
-     */
-    public PortletMode getPortletMode() {
-        return request.getPortletMode();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getPortletSession()</code> on the wrapped request object.
-     */
-    public PortletSession getPortletSession() {
-        return request.getPortletSession();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getPortletSession(create)</code> on the wrapped request object.
-     */
-    public PortletSession getPortletSession(boolean create) {
-        return request.getPortletSession(create);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getPreferences()</code> on the wrapped request object.
-     */
-    public PortletPreferences getPreferences() {
-        return request.getPreferences();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getProperteis(name)</code> on the wrapped request object.
-     */
-    public Enumeration<String> getProperties(String name) {
-        return request.getProperties(name);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getProperty(name)</code> on the wrapped request object.
-     */
-    public String getProperty(String name) {
-        return request.getProperty(name);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getPropertyNames()</code> on the wrapped request object.
-     */
-    public Enumeration<String> getPropertyNames() {
-        return request.getPropertyNames();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getRemoteUser()</code> on the wrapped request object.
-     */
-    public String getRemoteUser() {
-        return request.getRemoteUser();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getRequestedSessionId()</code> on the wrapped request object.
-     */
-    public String getRequestedSessionId() {
-        return request.getRequestedSessionId();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getResponseContentType()</code> on the wrapped request object.
-     */
-    public String getResponseContentType() {
-        return request.getResponseContentType();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getResponseContentTypes()</code> on the wrapped request object.
-     */
-    public Enumeration<String> getResponseContentTypes() {
-        return request.getResponseContentTypes();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getScheme()</code> on the wrapped request object.
-     */
-    public String getScheme() {
-        return request.getScheme();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getServerName()</code> on the wrapped request object.
-     */
-    public String getServerName() {
-        return request.getServerName();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getServerPort()</code> on the wrapped request object.
-     */
-    public int getServerPort() {
-        return request.getServerPort();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getUserPrincipal()</code> on the wrapped request object.
-     */
-    public Principal getUserPrincipal() {
-        return request.getUserPrincipal();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getWindowId()</code> on the wrapped request object.
-     */
-    public String getWindowId() {
-        return request.getWindowId();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getWindowState()</code> on the wrapped request object.
-     */
-    public WindowState getWindowState() {
-        return request.getWindowState();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>isPortletModeAllowed(mode)</code> on the wrapped request object.
-     */
-    public boolean isPortletModeAllowed(PortletMode mode) {
-        return request.isPortletModeAllowed(mode);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>isRequestedSessionIdValid()</code> on the wrapped request object.
-     */
-    public boolean isRequestedSessionIdValid() {
-        return request.isRequestedSessionIdValid();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>isSecure()</code> on the wrapped request object.
-     */
-    public boolean isSecure() {
-        return request.isSecure();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>isUserInRole(role)</code> on the wrapped request object.
-     */
-    public boolean isUserInRole(String role) {
-        return request.isUserInRole(role);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>isWindowStateAllowed(state)</code> on the wrapped request object.
-     */
-    public boolean isWindowStateAllowed(WindowState state) {
-        return request.isWindowStateAllowed(state);
+    	super(request);
+    	this.request = request;
     }
 
-    /**
-     * The default behavior of this method is to call 
-     * <code>removeAttribute(name)</code> on the wrapped request object.
-     */
-    public void removeAttribute(String name) {
-        request.removeAttribute(name);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>setAttribute(name, o)</code> on the wrapped request object.
-     */
-    public void setAttribute(String name, Object o) {
-        request.setAttribute(name, o);
-    }
+    
 
     /**
      * Return the wrapped request object.
@@ -372,7 +76,10 @@
      * @throws java.lang.IllegalArgumentException   if the request is null.
      */
     public void setRequest(RenderRequest request) {
-        this.request = request;
+    	if ( request == null)
+    		throw new java.lang.IllegalArgumentException("Request is null");
+
+    	this.request = request;
     }
 
     /**
@@ -383,12 +90,5 @@
         return request.getETag();
     }
 
-    /**
-     * The default behavior of this method is to call 
-     * <code>getCookies()</code> on the wrapped request object.
-     */
-    public Cookie[] getCookies() {
-        return request.getCookies();
-    }
 
 }

Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/RenderResponseWrapper.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/RenderResponseWrapper.java?view=diff&rev=559761&r1=559760&r2=559761
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/RenderResponseWrapper.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/RenderResponseWrapper.java Thu Jul 26 02:05:35 2007
@@ -33,15 +33,12 @@
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.PrintWriter;
-import java.util.Enumeration;
+import java.util.Collection;
 import java.util.Locale;
 
 import javax.portlet.CacheControl;
 import javax.portlet.PortletMode;
-import javax.portlet.PortletURL;
 import javax.portlet.RenderResponse;
-import javax.portlet.ResourceURL;
-import javax.servlet.http.Cookie;
 
 /**
  * The <code>RenderResponseWrapper</code> provides a convenient 
@@ -54,18 +51,10 @@
  * @see RenderResponse
  */
 
-public class RenderResponseWrapper implements RenderResponse {
+public class RenderResponseWrapper extends PortletResponseWrapper implements RenderResponse {
 
     RenderResponse response;
     
-    /** 
-     * Require having a response for constructing
-     * the wrapper.
-     *
-     */
-    private RenderResponseWrapper() {
-    }
-    
     /**
      * Creates an <code>RenderResponse</code> adaptor 
      * wrapping the given response object.
@@ -74,67 +63,8 @@
      * @throws java.lang.IllegalArgumentException if the response is <code>null</code>
      */
     public RenderResponseWrapper(RenderResponse response) {
-        this.response = response;
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>setEvent(name, value)</code> on the wrapped response object.
-     */
-     /**
-     * The default behavior of this method is to call 
-     * <code>addProperty(key, value)</code> on the wrapped response object.
-     */
-    public void addProperty(String key, String value) {
-        response.addProperty(key, value);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>createActionURL()</code> on the wrapped response object.
-     */
-    public PortletURL createActionURL() {
-        return response.createActionURL();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>createRenderURL()</code> on the wrapped response object.
-     */
-    public PortletURL createRenderURL() {
-        return response.createRenderURL();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>createResourceURL</code> on the wrapped response object.
-     */
-    public ResourceURL createResourceURL() {
-        return response.createResourceURL();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>encodeURL(path)</code> on the wrapped response object.
-     */
-    public String encodeURL(String path) {
-        return response.encodeURL(path);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getNamespace()</code> on the wrapped response object.
-     */
-    public String getNamespace() {
-        return response.getNamespace();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>setProperty(key, value)</code> on the wrapped response object.
-     */
-    public void setProperty(String key, String value) {
-        response.setProperty(key, value);
+    	super(response);
+    	this.response = response;
     }
 
     /**
@@ -251,18 +181,32 @@
 
     /**
      *  The default behavior of this method is to call 
-     * <code>addProperty()</code> on the wrapped response object.
+     * <code>setNextPossiblePortletModes()</code> on the wrapped response object.
      */
-    public void addProperty(Cookie cookie) {
-        response.addProperty(cookie);
+    public void setNextPossiblePortletModes(Collection<PortletMode> portletModes) {
+        response.setNextPossiblePortletModes(portletModes);
     }
 
     /**
-     *  The default behavior of this method is to call 
-     * <code>setNextPossiblePortletModes()</code> on the wrapped response object.
+     * Return the wrapped response object.
+     * 
+     * @return the wrapped response
      */
-    public void setNextPossiblePortletModes(Enumeration<PortletMode> portletModes) {
-        response.setNextPossiblePortletModes(portletModes);
+    public RenderResponse getResponse() {
+        return response;
+    }
+
+    /**
+     * Sets the response object being wrapped.
+     * 
+     * @param response the response to set
+     * @throws java.lang.IllegalArgumentException   if the response is null.
+     */
+    public void setResponse(RenderResponse response) {
+	    	if ( response == null)
+	    		throw new java.lang.IllegalArgumentException("Response is null");
+
+	    	this.response = response;
     }
 
 }

Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/ResourceFilter.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/ResourceFilter.java?view=diff&rev=559761&r1=559760&r2=559761
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/ResourceFilter.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/ResourceFilter.java Thu Jul 26 02:05:35 2007
@@ -51,28 +51,9 @@
  * 
  * @since 2.0
  */
-public interface ResourceFilter {
+public interface ResourceFilter extends PortletFilter {
 
     /**
-     * Called by the portlet container to indicate to a filter
-     * that it is being placed into service. The portlet container 
-     * calls the init method exactly once after instantiating the filter. 
-     * The init method must complete successfully before the filter 
-     * is asked to do any filtering work.
-     * <p>
-     * The portlet container cannot place the filter into service if the init method either
-     * <ul>
-     *   <li>throws a PortletException</li>
-     *   <li>does not return within a time period defined by the portlet container</li>
-     * </ul>
-     * 
-     * @param filterConfig    the filter configuration data defined 
-     *                        in the portlet deployment descriptor
-     * @throws PortletException  if an error occurs in the filter intialization
-     */
-    public void init(FilterConfig filterConfig) throws PortletException;
-    
-    /**
      * The <code>doFilter</code> method of the Filter is called by the 
      * portlet container each time a resource request/response pair is passed 
      * through the chain due to a client request for a portlet method 
@@ -132,21 +113,5 @@
     public void doFilter(ResourceRequest request, ResourceResponse response,
                          FilterChain chain)
      throws IOException, PortletException;
-    
-    /**
-     * Called by the portlet container to indicate to a filter that it is 
-     * being taken out of service. This method is only called once all threads 
-     * within the filter's <code>doFilter</code> method have exited or 
-     * after a timeout period has passed. 
-     * <p>
-     * After the portlet container calls this method, it will not call the 
-     * <code>doFilter</code> method again on this instance of the filter.
-     * <p>
-     * This method gives the filter an opportunity to clean up any resources 
-     * that are being held (for example, memory, file handles, threads) and 
-     * make sure that any persistent state is synchronized with the 
-     * filter's current state in memory.
-     */
-    public void destroy();
     
 }

Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/ResourceRequestWrapper.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/ResourceRequestWrapper.java?view=diff&rev=559761&r1=559760&r2=559761
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/ResourceRequestWrapper.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/ResourceRequestWrapper.java Thu Jul 26 02:05:35 2007
@@ -34,18 +34,8 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
-import java.security.Principal;
-import java.util.Enumeration;
-import java.util.Locale;
-import java.util.Map;
-
-import javax.portlet.PortalContext;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletPreferences;
-import javax.portlet.PortletSession;
+
 import javax.portlet.ResourceRequest;
-import javax.portlet.WindowState;
-import javax.servlet.http.Cookie;
 
 /**
  * The <code>ResourceRequestWrapper</code> provides a convenient 
@@ -57,18 +47,10 @@
  * @since 2.0
  * @see ResourceRequest
  */
-public class ResourceRequestWrapper implements ResourceRequest {
+public class ResourceRequestWrapper extends PortletRequestWrapper implements ResourceRequest {
 
     ResourceRequest request;
 
-    /** 
-     * Require having a request for constructing
-     * the wrapper.
-     *
-     */
-    private ResourceRequestWrapper() {
-    }
-    
     /**
      * Creates an <code>ResourceRequest</code> adaptor 
      * wrapping the given request object.
@@ -77,7 +59,8 @@
      * @throws java.lang.IllegalArgumentException if the request is <code>null</code>
      */
     public ResourceRequestWrapper(ResourceRequest request) {
-        this.request = request;
+    	super(request);
+    	this.request = request;
     }
 
     /**
@@ -107,285 +90,6 @@
        request.setCharacterEncoding(enc);
     }
     
-    /**
-     * The default behavior of this method is to call 
-     * <code>getAttribute(String name)</code> on the wrapped request object.
-     */
-    public Object getAttribute(String name) {
-        return request.getAttribute(name);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getAttributeNames()</code> on the wrapped request object.
-     */
-    public Enumeration<String> getAttributeNames() {
-        return request.getAttributeNames();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getAuthType()</code> on the wrapped request object.
-     */
-    public String getAuthType() {
-        return request.getAuthType();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getContextPath()</code> on the wrapped request object.
-     */
-    public String getContextPath() {
-        return request.getContextPath();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getLocale()</code> on the wrapped request object.
-     */
-    public Locale getLocale() {
-        return request.getLocale();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getLocales()</code> on the wrapped request object.
-     */
-    public Enumeration getLocales() {
-        return request.getLocales();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getParameter(String name)</code> on the wrapped request object.
-     */
-    public String getParameter(String name) {
-        return request.getParameter(name);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getParameterMap()</code> on the wrapped request object.
-     */
-    public Map<String, String[]> getParameterMap() {
-        return request.getParameterMap();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getParameterNames()</code> on the wrapped request object.
-     */
-    public Enumeration<String> getParameterNames() {
-        return request.getParameterNames();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getParameterValues(name)</code> on the wrapped request object.
-     */
-    public String[] getParameterValues(String name) {
-        return request.getParameterValues(name);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getPortalContext()</code> on the wrapped request object.
-     */
-    public PortalContext getPortalContext() {
-        return request.getPortalContext();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getPortletMode()</code> on the wrapped request object.
-     */
-    public PortletMode getPortletMode() {
-        return request.getPortletMode();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getPortletSession()</code> on the wrapped request object.
-     */
-    public PortletSession getPortletSession() {
-        return request.getPortletSession();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getPortletSession(create)</code> on the wrapped request object.
-     */
-    public PortletSession getPortletSession(boolean create) {
-        return request.getPortletSession(create);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getPreferences()</code> on the wrapped request object.
-     */
-    public PortletPreferences getPreferences() {
-        return request.getPreferences();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getProperteis(name)</code> on the wrapped request object.
-     */
-    public Enumeration<String> getProperties(String name) {
-        return request.getProperties(name);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getProperty(name)</code> on the wrapped request object.
-     */
-    public String getProperty(String name) {
-        return request.getProperty(name);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getPropertyNames()</code> on the wrapped request object.
-     */
-    public Enumeration<String> getPropertyNames() {
-        return request.getPropertyNames();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getRemoteUser()</code> on the wrapped request object.
-     */
-    public String getRemoteUser() {
-        return request.getRemoteUser();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getRequestedSessionId()</code> on the wrapped request object.
-     */
-    public String getRequestedSessionId() {
-        return request.getRequestedSessionId();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getResponseContentType()</code> on the wrapped request object.
-     */
-    public String getResponseContentType() {
-        return request.getResponseContentType();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getResponseContentTypes()</code> on the wrapped request object.
-     */
-    public Enumeration<String> getResponseContentTypes() {
-        return request.getResponseContentTypes();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getScheme()</code> on the wrapped request object.
-     */
-    public String getScheme() {
-        return request.getScheme();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getServerName()</code> on the wrapped request object.
-     */
-    public String getServerName() {
-        return request.getServerName();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getServerPort()</code> on the wrapped request object.
-     */
-    public int getServerPort() {
-        return request.getServerPort();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getUserPrincipal()</code> on the wrapped request object.
-     */
-    public Principal getUserPrincipal() {
-        return request.getUserPrincipal();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getWindowId()</code> on the wrapped request object.
-     */
-    public String getWindowId() {
-        return request.getWindowId();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getWindowState()</code> on the wrapped request object.
-     */
-    public WindowState getWindowState() {
-        return request.getWindowState();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>isPortletModeAllowed(mode)</code> on the wrapped request object.
-     */
-    public boolean isPortletModeAllowed(PortletMode mode) {
-        return request.isPortletModeAllowed(mode);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>isRequestedSessionIdValid()</code> on the wrapped request object.
-     */
-    public boolean isRequestedSessionIdValid() {
-        return request.isRequestedSessionIdValid();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>isSecure()</code> on the wrapped request object.
-     */
-    public boolean isSecure() {
-        return request.isSecure();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>isUserInRole(role)</code> on the wrapped request object.
-     */
-    public boolean isUserInRole(String role) {
-        return request.isUserInRole(role);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>isWindowStateAllowed(state)</code> on the wrapped request object.
-     */
-    public boolean isWindowStateAllowed(WindowState state) {
-        return request.isWindowStateAllowed(state);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>removeAttribute(name)</code> on the wrapped request object.
-     */
-    public void removeAttribute(String name) {
-        request.removeAttribute(name);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>setAttribute(name, o)</code> on the wrapped request object.
-     */
-    public void setAttribute(String name, Object o) {
-        request.setAttribute(name, o);
-    }
 
     /**
      * Return the wrapped request object.
@@ -403,7 +107,10 @@
      * @throws java.lang.IllegalArgumentException   if the request is null.
      */
     public void setRequest(ResourceRequest request) {
-        this.request = request;
+    	if ( request == null)
+    		throw new java.lang.IllegalArgumentException("Request is null");
+
+    	this.request = request;
     }
 
     /**
@@ -455,12 +162,4 @@
     }
 
 
-    /**
-     * The default behavior of this method is to call 
-     * <code>getCookies()</code> on the wrapped request object.
-     */
-    public Cookie[] getCookies() {
-        return request.getCookies();
-    }
-    
 }

Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/ResourceResponseWrapper.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/ResourceResponseWrapper.java?view=diff&rev=559761&r1=559760&r2=559761
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/ResourceResponseWrapper.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/ResourceResponseWrapper.java Thu Jul 26 02:05:35 2007
@@ -36,10 +36,7 @@
 import java.util.Locale;
 
 import javax.portlet.CacheControl;
-import javax.portlet.PortletURL;
 import javax.portlet.ResourceResponse;
-import javax.portlet.ResourceURL;
-import javax.servlet.http.Cookie;
 
 /**
  * The <code>ResourceResponseWrapper</code> provides a convenient 
@@ -52,18 +49,10 @@
  * @see ResourceResponse
  */
 
-public class ResourceResponseWrapper implements ResourceResponse {
+public class ResourceResponseWrapper extends PortletResponseWrapper implements ResourceResponse {
 
     ResourceResponse response;
     
-    /** 
-     * Require having a response for constructing
-     * the wrapper.
-     *
-     */
-    private ResourceResponseWrapper() {
-    }
-    
     /**
      * Creates an <code>ResourceResponse</code> adaptor 
      * wrapping the given response object.
@@ -72,67 +61,8 @@
      * @throws java.lang.IllegalArgumentException if the response is <code>null</code>
      */
     public ResourceResponseWrapper(ResourceResponse response) {
-        this.response = response;
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>setEvent(name, value)</code> on the wrapped response object.
-     */
-     /**
-     * The default behavior of this method is to call 
-     * <code>addProperty(key, value)</code> on the wrapped response object.
-     */
-    public void addProperty(String key, String value) {
-        response.addProperty(key, value);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>createActionURL()</code> on the wrapped response object.
-     */
-    public PortletURL createActionURL() {
-        return response.createActionURL();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>createRenderURL()</code> on the wrapped response object.
-     */
-    public PortletURL createRenderURL() {
-        return response.createRenderURL();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>createResourceURL</code> on the wrapped response object.
-     */
-    public ResourceURL createResourceURL() {
-        return response.createResourceURL();
-    }
-
-   /**
-     * The default behavior of this method is to call 
-     * <code>encodeURL(path)</code> on the wrapped response object.
-     */
-    public String encodeURL(String path) {
-        return response.encodeURL(path);
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>getNamespace()</code> on the wrapped response object.
-     */
-    public String getNamespace() {
-        return response.getNamespace();
-    }
-
-    /**
-     * The default behavior of this method is to call 
-     * <code>setProperty(key, value)</code> on the wrapped response object.
-     */
-    public void setProperty(String key, String value) {
-        response.setProperty(key, value);
+    	super(response);
+    	this.response = response;
     }
 
     /**
@@ -260,18 +190,32 @@
 
     /**
      *  The default behavior of this method is to call 
-     * <code>addProperty()</code> on the wrapped response object.
+     * <code>setContentLength()</code> on the wrapped response object.
      */
-    public void addProperty(Cookie cookie) {
-        response.addProperty(cookie);
+    public void setContentLength(int len) {
+        response.setContentLength(len);
     }
 
     /**
-     *  The default behavior of this method is to call 
-     * <code>setContentLength()</code> on the wrapped response object.
+     * Return the wrapped response object.
+     * 
+     * @return the wrapped response
      */
-    public void setContentLength(int len) {
-        response.setContentLength(len);
+    public ResourceResponse getResponse() {
+        return response;
+    }
+
+    /**
+     * Sets the response object being wrapped.
+     * 
+     * @param response the response to set
+     * @throws java.lang.IllegalArgumentException   if the response is null.
+     */
+    public void setResponse(ResourceResponse response) {
+	    	if ( response == null)
+	    		throw new java.lang.IllegalArgumentException("Response is null");
+
+	    	this.response = response;
     }
 
 }

Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/license.txt
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/license.txt?view=diff&rev=559761&r1=559760&r2=559761
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/license.txt (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/license.txt Thu Jul 26 02:05:35 2007
@@ -1,2 +1,2 @@
-Copyright IBM Corporation. 
+© Copyright IBM Corp. 2006, 2007
 All rights reserved.