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/04/18 13:30:44 UTC
svn commit: r529986 [10/11] - in
/portals/pluto/branches/1.1-286-COMPATIBILITY: ./
maven-pluto-plugin/src/main/java/org/apache/pluto/maven/
maven-pluto-plugin/src/main/resources/ pluto-container/
pluto-container/src/main/java/org/apache/pluto/ pluto-co...
Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/ActionRequestWrapper.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/ActionRequestWrapper.java?view=diff&rev=529986&r1=529985&r2=529986
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/ActionRequestWrapper.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/ActionRequestWrapper.java Wed Apr 18 04:30:37 2007
@@ -1,17 +1,23 @@
-/*
- * Copyright 2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* 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
+ * 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.
+ * 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
@@ -20,6 +26,7 @@
*/
/*
* Copyright 2006 IBM Corporation.
+ *
*/
package javax.portlet.filter;
@@ -38,6 +45,7 @@
import javax.portlet.PortletPreferences;
import javax.portlet.PortletSession;
import javax.portlet.WindowState;
+import javax.servlet.http.Cookie;
/**
* The <code>ActionRequestWrapper</code> provides a convenient
@@ -420,6 +428,30 @@
*/
public void setRequest(ActionRequest request) {
this.request = request;
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getLifecyclePhase()</code> on the wrapped request object.
+ */
+ public String getLifecyclePhase() {
+ return request.getLifecyclePhase();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getCookieProperties()</code> on the wrapped request object.
+ */
+ public Cookie[] getCookieProperties() {
+ return request.getCookieProperties();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getMethod()</code> on the wrapped request object.
+ */
+ public String getMethod() {
+ return request.getMethod();
}
}
Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/ActionResponseWrapper.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/ActionResponseWrapper.java?view=diff&rev=529986&r1=529985&r2=529986
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/ActionResponseWrapper.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/ActionResponseWrapper.java Wed Apr 18 04:30:37 2007
@@ -1,17 +1,23 @@
-/*
- * Copyright 2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* 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
+ * 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.
+ * 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
@@ -20,19 +26,23 @@
*/
/*
* Copyright 2006 IBM Corporation.
+ *
*/
package javax.portlet.filter;
import java.io.IOException;
+import java.util.Enumeration;
import java.util.Map;
import javax.portlet.ActionResponse;
+import javax.portlet.FragmentURL;
import javax.portlet.PortletMode;
import javax.portlet.PortletModeException;
import javax.portlet.PortletURL;
import javax.portlet.ResourceURL;
import javax.portlet.WindowState;
import javax.portlet.WindowStateException;
+import javax.xml.namespace.QName;
/**
* The <code>ActionResponseWrapper</code> provides a convenient
@@ -79,7 +89,7 @@
* The default behavior of this method is to call
* <code>setEvent(name, value)</code> on the wrapped response object.
*/
- public void setEvent(String name, Object value) {
+ public void setEvent(QName name, Object value) {
response.setEvent(name, value);
}
@@ -143,14 +153,6 @@
/**
* The default behavior of this method is to call
- * <code>addProperty(key, value, scope)</code> on the wrapped response object.
- */
- public void addProperty(String key, String value, int scope) {
- response.addProperty(key, value, scope);
- }
-
- /**
- * The default behavior of this method is to call
* <code>createActionURL()</code> on the wrapped response object.
*/
public PortletURL createActionURL() {
@@ -175,6 +177,14 @@
/**
* The default behavior of this method is to call
+ * <code>createResourceURL</code> on the wrapped response object.
+ */
+ public ResourceURL createResourceURL(boolean markupContainsPortletURLs) {
+ return response.createResourceURL(markupContainsPortletURLs);
+ }
+
+ /**
+ * The default behavior of this method is to call
* <code>encodeURL(path)</code> on the wrapped response object.
*/
public String encodeURL(String path) {
@@ -198,14 +208,6 @@
}
/**
- * The default behavior of this method is to call
- * <code>setProperty(key, value, scope)</code> on the wrapped response object.
- */
- public void setProperty(String key, String value, int scope) {
- response.setProperty(key, value, scope);
- }
-
- /**
* Return the wrapped response object.
*
* @return the wrapped response
@@ -223,5 +225,46 @@
public void setResponse(ActionResponse response) {
this.response = response;
}
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getPortletMode()</code> on the wrapped response object.
+ */
+ public PortletMode getPortletMode() {
+ return response.getPortletMode();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getRenderParameterMap()</code> on the wrapped response object.
+ */
+ public Map getRenderParameterMap() {
+ return response.getRenderParameterMap();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getWindowState()</code> on the wrapped response object.
+ */
+ public WindowState getWindowState() {
+ return response.getWindowState();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>createFragmentURL()</code> on the wrapped response object.
+ */
+ public FragmentURL createFragmentURL() {
+ return response.createFragmentURL();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setNextPossiblePortletModes()</code> on the wrapped response object.
+ */
+ public void setNextPossiblePortletModes(Enumeration portletModes) {
+ response.setNextPossiblePortletModes(portletModes);
+ }
+
}
Added: portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/EventFilter.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/EventFilter.java?view=auto&rev=529986
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/EventFilter.java (added)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/EventFilter.java Wed Apr 18 04:30:37 2007
@@ -0,0 +1,152 @@
+/* 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 java.io.IOException;
+
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.PortletException;
+
+/**
+ * The <code>EventFilter</code> is an object that performs filtering
+ * tasks on either the event request to a portlet, or on the event response from
+ * a portlet, or both.
+ * <p>
+ * Filters perform filtering in the <code>doFilter</code> method. Every Filter has
+ * access to a <code>FilterConfig</code> object from which it can obtain
+ * its initialization parameters, a reference to the PortletContext
+ * which it can use, for example, to load resources needed for filtering tasks.
+ * <p>
+ * Filters are configured in the portlet deployment descriptor of a
+ * portlet application.
+ *
+ * @since 2.0
+ */
+public interface EventFilter {
+
+ /**
+ * 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 event request/response pair is passed
+ * through the chain due to a client request for a portlet method
+ * at the end of the chain.
+ * <p>
+ * The <code>FilterChain</code> passed in to this method allows
+ * the Filter to pass on the event request and response to the next
+ * component in the chain.
+ * <p>
+ * The <code>doFilter</code> method of a filter will typically be implemented
+ * following this or some subset of the following pattern:
+ * <ul>
+ * <li>The method examines the request information.</li>
+ * <li>The method may wrap the request object passed in to
+ * its doFilter method with a customized implementation
+ * the request wrapper <code>ActionRequestWrapper</code>
+ * in order to modify request data.</li>
+ * <li>The method may wrap the response object passed in to its
+ * <code>doFilter</code> method with a customized implementation
+ * of the response wrapper <code>ActionResponseWrapper</code>
+ * to modify response data.</li>
+ * <li>The filter may invoke the next comonent in the filter chain.
+ * The next component may be another filter, or if the filter
+ * making the invocation is the last filter configured in the
+ * deployment descriptor for this chain, the next component
+ * is the target method of the portlet. The invocation of the
+ * next component is effected by calling the <code>doFilter>/code>
+ * method on the <code>FilterChain</code> object, and passing in
+ * the request and response with which it was called or passing
+ * in wrapped versions it may have created.
+ * The filter chains implementation of the <code>doFilter</code>
+ * method, provided by the portlet container, must locate the
+ * next component in the filter chain and invoke its <code>doFilter</code>
+ * method, passing in the appropriate request and response objects.
+ * Alternatively, the filter chain can block the request by not
+ * making the call to invoke the next component, leaving the filter
+ * responsible for filling out the response object.</li>
+ * <li>After invocation of the next filter in the chain, the filter
+ * may examine the response data.</li>
+ * <li>Alternatively, the filter may have thrown an exception to
+ * indicate an error in processing. If the filter throws an
+ * <code>UnavailableException</code> during its <code>doFilter</code>
+ * processing, the portlet container must not attempt continued
+ * processing down the filter chain. It may choose to retry the
+ * whole chain at a later time if the exception is not marked permanent.</li>
+ * <li>When the last filter in the chain has been invoked, the next
+ * component accessed is the target method on the portlet at
+ * the end of the chain.</li>
+ * </ul>
+ *
+ * @param request the current event request
+ * @param response the current event response
+ * @param chain the remaining filter chain
+ * @throws IOException if an IO error occured in the filter processing
+ * @throws PortletException if a portlet exception occured in the filter processing
+ */
+ public void doFilter(EventRequest request, EventResponse 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/EventRequestWrapper.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/EventRequestWrapper.java?view=diff&rev=529986&r1=529985&r2=529986
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/EventRequestWrapper.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/EventRequestWrapper.java Wed Apr 18 04:30:37 2007
@@ -1,17 +1,23 @@
-/*
- * Copyright 2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* 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
+ * 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.
+ * 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
@@ -20,6 +26,7 @@
*/
/*
* Copyright 2006 IBM Corporation.
+ *
*/
package javax.portlet.filter;
@@ -35,6 +42,7 @@
import javax.portlet.PortletPreferences;
import javax.portlet.PortletSession;
import javax.portlet.WindowState;
+import javax.servlet.http.Cookie;
/**
* The <code>EventRequestWrapper</code> provides a convenient
@@ -374,6 +382,31 @@
*/
public Event getEvent() {
return request.getEvent();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getLifecyclePhase()</code> on the wrapped request object.
+ */
+ public String getLifecyclePhase() {
+ return request.getLifecyclePhase();
+ }
+
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getCookieProperties()</code> on the wrapped request object.
+ */
+ public Cookie[] getCookieProperties() {
+ return request.getCookieProperties();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getMethod()</code> on the wrapped request object.
+ */
+ public String getMethod() {
+ return request.getMethod();
}
}
Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/EventResponseWrapper.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/EventResponseWrapper.java?view=diff&rev=529986&r1=529985&r2=529986
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/EventResponseWrapper.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/EventResponseWrapper.java Wed Apr 18 04:30:37 2007
@@ -1,17 +1,23 @@
-/*
- * Copyright 2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* 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
+ * 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.
+ * 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
@@ -20,18 +26,23 @@
*/
/*
* Copyright 2006 IBM Corporation.
+ *
*/
package javax.portlet.filter;
+import java.util.Enumeration;
import java.util.Map;
+import javax.portlet.EventRequest;
import javax.portlet.EventResponse;
+import javax.portlet.FragmentURL;
import javax.portlet.PortletMode;
import javax.portlet.PortletModeException;
import javax.portlet.PortletURL;
import javax.portlet.ResourceURL;
import javax.portlet.WindowState;
import javax.portlet.WindowStateException;
+import javax.xml.namespace.QName;
/**
* The <code>EventResponseWrapper</code> provides a convenient
@@ -71,7 +82,7 @@
* The default behavior of this method is to call
* <code>setEvent(name, value)</code> on the wrapped response object.
*/
- public void setEvent(String name, Object value) {
+ public void setEvent(QName name, Object value) {
response.setEvent(name, value);
}
@@ -133,15 +144,7 @@
response.addProperty(key, value);
}
- /**
- * The default behavior of this method is to call
- * <code>addProperty(key, value, scope)</code> on the wrapped response object.
- */
- public void addProperty(String key, String value, int scope) {
- response.addProperty(key, value, scope);
- }
-
- /**
+ /**
* The default behavior of this method is to call
* <code>createActionURL()</code> on the wrapped response object.
*/
@@ -167,6 +170,14 @@
/**
* The default behavior of this method is to call
+ * <code>createResourceURL</code> on the wrapped response object.
+ */
+ public ResourceURL createResourceURL(boolean markupContainsPortletURLs) {
+ return response.createResourceURL(markupContainsPortletURLs);
+ }
+
+ /**
+ * The default behavior of this method is to call
* <code>encodeURL(path)</code> on the wrapped response object.
*/
public String encodeURL(String path) {
@@ -190,14 +201,6 @@
}
/**
- * The default behavior of this method is to call
- * <code>setProperty(key, value, scope)</code> on the wrapped response object.
- */
- public void setProperty(String key, String value, int scope) {
- response.setProperty(key, value, scope);
- }
-
- /**
* Return the wrapped response object.
*
* @return the wrapped response
@@ -214,6 +217,54 @@
*/
public void setResponse(EventResponse response) {
this.response = response;
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getPortletMode()</code> on the wrapped response object.
+ */
+ public PortletMode getPortletMode() {
+ return response.getPortletMode();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getRenderParameterMap()</code> on the wrapped response object.
+ */
+ public Map getRenderParameterMap() {
+ return response.getRenderParameterMap();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getWindowState()</code> on the wrapped response object.
+ */
+ public WindowState getWindowState() {
+ return response.getWindowState();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>createFragmentURL()</code> on the wrapped response object.
+ */
+ public FragmentURL createFragmentURL() {
+ return response.createFragmentURL();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setNextPossiblePortletModes()</code> on the wrapped response object.
+ */
+ public void setNextPossiblePortletModes(Enumeration portletModes) {
+ response.setNextPossiblePortletModes(portletModes);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setRenderParameters()</code> on the wrapped response object.
+ */
+ public void setRenderParameters(EventRequest request) {
+ response.setRenderParameters(request);
}
}
Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/Filter.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/Filter.java?view=diff&rev=529986&r1=529985&r2=529986
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/Filter.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/Filter.java Wed Apr 18 04:30:37 2007
@@ -1,17 +1,23 @@
-/*
- * Copyright 2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* 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
+ * 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.
+ * 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
Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/FilterChain.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/FilterChain.java?view=diff&rev=529986&r1=529985&r2=529986
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/FilterChain.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/FilterChain.java Wed Apr 18 04:30:37 2007
@@ -1,17 +1,23 @@
-/*
- * Copyright 2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* 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
+ * 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.
+ * 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
@@ -20,14 +26,23 @@
*/
/*
* Copyright 2006 IBM Corporation.
+ *
*/
package javax.portlet.filter;
import java.io.IOException;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.FragmentRequest;
+import javax.portlet.FragmentResponse;
import javax.portlet.PortletException;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletResponse;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
/**
* A <code>FilterChain</code> is an object provided by the portlet container
@@ -45,19 +60,70 @@
* or if the calling filter is the last filter in the chain,
* causes the portlet at the end of the chain to be invoked.
*
- * @param request the current request, must be of type
- * <code>ActionRequest</code>,
- * <code>EventRequest</code>,
- * <code>RenderRequest</code>, or
- * <code>ResourceRequest.</code>
- * @param response the current response, nust be of type
- * <code>ActionResponse</code>,
- * <code>EventReaponse</code>, or
- * <code>RenderResponse</code>.
+ * @param request the current action request.
+ * @param response the current action response
+ *
* @throws IOException if an IO error occured in the filter processing
* @throws PortletException if a portlet exception occured in the filter processing
*/
- public void doFilter(PortletRequest request, PortletResponse response)
+ public void doFilter(ActionRequest request, ActionResponse response)
+ throws IOException, PortletException;
+
+ /**
+ * Causes the next filter in the chain to be invoked,
+ * or if the calling filter is the last filter in the chain,
+ * causes the portlet at the end of the chain to be invoked.
+ *
+ * @param request the current event request.
+ * @param response the current event response.
+ *
+ * @throws IOException if an IO error occured in the filter processing
+ * @throws PortletException if a portlet exception occured in the filter processing
+ */
+ public void doFilter(EventRequest request, EventResponse response)
+ throws IOException, PortletException;
+
+ /**
+ * Causes the next filter in the chain to be invoked,
+ * or if the calling filter is the last filter in the chain,
+ * causes the portlet at the end of the chain to be invoked.
+ *
+ * @param request the current render request.
+ *
+ * @param response the current render response.
+ *
+ * @throws IOException if an IO error occured in the filter processing
+ * @throws PortletException if a portlet exception occured in the filter processing
+ */
+ public void doFilter(RenderRequest request, RenderResponse response)
throws IOException, PortletException;
+ /**
+ * Causes the next filter in the chain to be invoked,
+ * or if the calling filter is the last filter in the chain,
+ * causes the portlet at the end of the chain to be invoked.
+ *
+ * @param request the current resource request.
+ * @param response the current resource response.
+ *
+ * @throws IOException if an IO error occured in the filter processing
+ * @throws PortletException if a portlet exception occured in the filter processing
+ */
+ public void doFilter(ResourceRequest request, ResourceResponse response)
+ throws IOException, PortletException;
+
+ /**
+ * Causes the next filter in the chain to be invoked,
+ * or if the calling filter is the last filter in the chain,
+ * causes the portlet at the end of the chain to be invoked.
+ *
+ * @param request the current fragment request.
+ * @param response the current fragment response.
+ *
+ * @throws IOException if an IO error occured in the filter processing
+ * @throws PortletException if a portlet exception occured in the filter processing
+ */
+ public void doFilter(FragmentRequest request, FragmentResponse response)
+ throws IOException, PortletException;
+
}
Modified: portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/FilterConfig.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/FilterConfig.java?view=diff&rev=529986&r1=529985&r2=529986
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/FilterConfig.java (original)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/FilterConfig.java Wed Apr 18 04:30:37 2007
@@ -1,17 +1,23 @@
-/*
- * Copyright 2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* 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
+ * 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.
+ * 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
@@ -19,7 +25,8 @@
* DO NOT add / change / or delete method signatures!
*/
/*
- * Copyright 2006 IBM Corporation.
+ * Created on Jun 29, 2006
+ *
*/
package javax.portlet.filter;
Added: portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/FragmentFilter.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/FragmentFilter.java?view=auto&rev=529986
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/FragmentFilter.java (added)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/FragmentFilter.java Wed Apr 18 04:30:37 2007
@@ -0,0 +1,152 @@
+/* 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 java.io.IOException;
+
+import javax.portlet.FragmentRequest;
+import javax.portlet.FragmentResponse;
+import javax.portlet.PortletException;
+
+/**
+ * The <code>FragmentFilter</code> is an object that performs filtering
+ * tasks on either the fragment request to a portlet, or on the fragment response from
+ * a portlet, or both.
+ * <p>
+ * Filters perform filtering in the <code>doFilter</code> method. Every Filter has
+ * access to a <code>FilterConfig</code> object from which it can obtain
+ * its initialization parameters, a reference to the PortletContext
+ * which it can use, for example, to load resources needed for filtering tasks.
+ * <p>
+ * Filters are configured in the portlet deployment descriptor of a
+ * portlet application.
+ *
+ * @since 2.0
+ */
+public interface FragmentFilter {
+ /**
+ * 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 fragment request/response pair is passed
+ * through the chain due to a client request for a portlet method
+ * at the end of the chain.
+ * <p>
+ * The <code>FilterChain</code> passed in to this method allows
+ * the Filter to pass on the fragment request and response to the next
+ * component in the chain.
+ * <p>
+ * The <code>doFilter</code> method of a filter will typically be implemented
+ * following this or some subset of the following pattern:
+ * <ul>
+ * <li>The method examines the request information.</li>
+ * <li>The method may wrap the request object passed in to
+ * its doFilter method with a customized implementation
+ * the request wrapper <code>FragmentRequestWrapper</code>
+ * in order to modify request data.</li>
+ * <li>The method may wrap the response object passed in to its
+ * <code>doFilter</code> method with a customized implementation
+ * of the response wrapper <code>FragmentResponseWrapper</code>
+ * to modify response data.</li>
+ * <li>The filter may invoke the next comonent in the filter chain.
+ * The next component may be another filter, or if the filter
+ * making the invocation is the last filter configured in the
+ * deployment descriptor for this chain, the next component
+ * is the target method of the portlet. The invocation of the
+ * next component is effected by calling the <code>doFilter>/code>
+ * method on the <code>FilterChain</code> object, and passing in
+ * the request and response with which it was called or passing
+ * in wrapped versions it may have created.
+ * The filter chains implementation of the <code>doFilter</code>
+ * method, provided by the portlet container, must locate the
+ * next component in the filter chain and invoke its <code>doFilter</code>
+ * method, passing in the appropriate request and response objects.
+ * Alternatively, the filter chain can block the request by not
+ * making the call to invoke the next component, leaving the filter
+ * responsible for filling out the response object.</li>
+ * <li>After invocation of the next filter in the chain, the filter
+ * may examine the response data.</li>
+ * <li>Alternatively, the filter may have thrown an exception to
+ * indicate an error in processing. If the filter throws an
+ * <code>UnavailableException</code> during its <code>doFilter</code>
+ * processing, the portlet container must not attempt continued
+ * processing down the filter chain. It may choose to retry the
+ * whole chain at a later time if the exception is not marked permanent.</li>
+ * <li>When the last filter in the chain has been invoked, the next
+ * component accessed is the target method on the portlet at
+ * the end of the chain.</li>
+ * </ul>
+ *
+ * @param request the current fragment request
+ * @param response the current fragment response
+ * @param chain the remaining filter chain
+ * @throws IOException if an IO error occured in the filter processing
+ * @throws PortletException if a portlet exception occured in the filter processing
+ */
+ public void doFilter(FragmentRequest request, FragmentResponse 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();
+
+
+}
Added: portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/FragmentRequestWrapper.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/FragmentRequestWrapper.java?view=auto&rev=529986
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/FragmentRequestWrapper.java (added)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/FragmentRequestWrapper.java Wed Apr 18 04:30:37 2007
@@ -0,0 +1,457 @@
+/* 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 java.io.BufferedReader;
+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.FragmentRequest;
+import javax.portlet.PortalContext;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletPreferences;
+import javax.portlet.PortletSession;
+import javax.portlet.WindowState;
+import javax.servlet.http.Cookie;
+
+/**
+ * The <code>FragmentRequestWrapper</code> provides a convenient
+ * implementation of the <code>FragmentRequest</code> interface
+ * that can be subclassed by developers wishing to adapt the request.
+ * This class implements the Wrapper or Decorator pattern.
+ * Methods default to calling through to the wrapped request object.
+ *
+ * @since 2.0
+ * @see FragmentRequest
+ */
+public class FragmentRequestWrapper implements FragmentRequest {
+
+ FragmentRequest request;
+
+ /**
+ * Require having a request for constructing
+ * the wrapper.
+ *
+ */
+ private FragmentRequestWrapper() {
+ }
+
+ /**
+ * Creates an <code>ResourceRequest</code> adaptor
+ * wrapping the given request object.
+ *
+ * @param request the fragment request to wrap
+ * @throws java.lang.IllegalArgumentException if the request is <code>null</code>
+ */
+ public FragmentRequestWrapper(FragmentRequest request) {
+ this.request = request;
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getPortletInputStream()</code> on the wrapped request object.
+ */
+ public InputStream getPortletInputStream() throws IOException {
+ return request.getPortletInputStream();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getReader()</code> on the wrapped request object.
+ */
+ public BufferedReader getReader() throws UnsupportedEncodingException,
+ IOException {
+ return request.getReader();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setCharacterEncoding(String enc)</code>
+ * on the wrapped request object.
+ */
+ public void setCharacterEncoding(String enc)
+ throws UnsupportedEncodingException {
+ 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 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 getParameterMap() {
+ return request.getParameterMap();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getParameterNames()</code> on the wrapped request object.
+ */
+ public Enumeration 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 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 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 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.
+ *
+ * @return the wrapped request
+ */
+ public FragmentRequest getRequest() {
+ return request;
+ }
+
+ /**
+ * Sets the request object being wrapped.
+ *
+ * @param request the request to set
+ * @throws java.lang.IllegalArgumentException if the request is null.
+ */
+ public void setRequest(FragmentRequest request) {
+ this.request = request;
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getCharacterEncoding()</code> on the wrapped request object.
+ */
+ public String getCharacterEncoding() {
+ return request.getCharacterEncoding();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getContentLength()</code> on the wrapped request object.
+ */
+ public int getContentLength() {
+ return request.getContentLength();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getContentType()</code> on the wrapped request object.
+ */
+ public String getContentType() {
+ return request.getContentType();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getLifecyclePhase()</code> on the wrapped request object.
+ */
+ public String getLifecyclePhase() {
+ return request.getLifecyclePhase();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getMethod()</code> on the wrapped request object.
+ */
+ public String getMethod() {
+ return request.getMethod();
+ }
+
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getCookieProperties()</code> on the wrapped request object.
+ */
+ public Cookie[] getCookieProperties() {
+ return request.getCookieProperties();
+ }
+}
Added: portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/FragmentResponseWrapper.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/FragmentResponseWrapper.java?view=auto&rev=529986
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/FragmentResponseWrapper.java (added)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/FragmentResponseWrapper.java Wed Apr 18 04:30:37 2007
@@ -0,0 +1,408 @@
+/* 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 java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.util.Enumeration;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.portlet.CacheControl;
+import javax.portlet.FragmentRequest;
+import javax.portlet.FragmentResponse;
+import javax.portlet.FragmentURL;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletModeException;
+import javax.portlet.PortletURL;
+import javax.portlet.ResourceURL;
+import javax.portlet.WindowState;
+import javax.portlet.WindowStateException;
+import javax.servlet.http.Cookie;
+import javax.xml.namespace.QName;
+
+
+/**
+ * The <code>FragmentResponseWrapper</code> provides a convenient
+ * implementation of the <code>FragmentResponse</code> interface
+ * that can be subclassed by developers wishing to adapt the response.
+ * This class implements the Wrapper or Decorator pattern.
+ * Methods default to calling through to the wrapped response object.
+ *
+ * @since 2.0
+ * @see FragmentResponse
+ */
+public class FragmentResponseWrapper implements FragmentResponse {
+
+ FragmentResponse response;
+
+ /**
+ * Require having a response for constructing
+ * the wrapper.
+ *
+ */
+ private FragmentResponseWrapper() {
+ }
+
+ /**
+ * Creates an <code>FragmentResponse</code> adaptor
+ * wrapping the given response object.
+ *
+ * @param response the event response to wrap
+ * @throws java.lang.IllegalArgumentException if the response is <code>null</code>
+ */
+ public FragmentResponseWrapper(FragmentResponse 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>createResourceURL</code> on the wrapped response object.
+ */
+ public ResourceURL createResourceURL(boolean markupContainsPortletURLs) {
+ return response.createResourceURL(markupContainsPortletURLs);
+ }
+
+ /**
+ * 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);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>flushBuffer()</code> on the wrapped response object.
+ */
+ public void flushBuffer() throws IOException {
+ response.flushBuffer();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getBufferSize()</code> on the wrapped response object.
+ */
+ public int getBufferSize() {
+ return response.getBufferSize();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getCharacterEncoding()</code> on the wrapped response object.
+ */
+ public String getCharacterEncoding() {
+ return response.getCharacterEncoding();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getContentType()</code> on the wrapped response object.
+ */
+ public String getContentType() {
+ return response.getContentType();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getLocale()</code> on the wrapped response object.
+ */
+ public Locale getLocale() {
+ return response.getLocale();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getPortletOutputStream()</code> on the wrapped response object.
+ */
+ public OutputStream getPortletOutputStream() throws IOException {
+ return response.getPortletOutputStream();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getWriter()</code> on the wrapped response object.
+ */
+ public PrintWriter getWriter() throws IOException {
+ return response.getWriter();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>isCommitted()</code> on the wrapped response object.
+ */
+ public boolean isCommitted() {
+ return response.isCommitted();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>reset()</code> on the wrapped response object.
+ */
+ public void reset() {
+ response.reset();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>resetBuffer()</code> on the wrapped response object.
+ */
+ public void resetBuffer() {
+ response.resetBuffer();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setBufferSize(size)</code> on the wrapped response object.
+ */
+ public void setBufferSize(int size) {
+ response.setBufferSize(size);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setContentType(type)</code> on the wrapped response object.
+ */
+ public void setContentType(String type) {
+ response.setContentType(type);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setTitle(title)</code> on the wrapped response object.
+ */
+ public void setTitle(String title) {
+ response.setTitle(title);
+ }
+
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getCacheControl()</code> on the wrapped response object.
+ */
+ public CacheControl getCacheControl() {
+ return response.getCacheControl();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setCharacterEncoding(String charset)</code> on the wrapped response object.
+ */
+ public void setCharacterEncoding(String charset) {
+ this.setCharacterEncoding(charset);
+ return;
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setLocale(Locale loc)</code> on the wrapped response object.
+ */
+ public void setLocale(Locale loc) {
+ this.setLocale(loc);
+ return;
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>createFragmentURL()</code> on the wrapped response object.
+ */
+ public FragmentURL createFragmentURL() {
+ return response.createFragmentURL();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setNextPossiblePortletModes()</code> on the wrapped response object.
+ */
+ public void setNextPossiblePortletModes(Enumeration portletModes) {
+ response.setNextPossiblePortletModes(portletModes);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>sendRedirect(location)</code> on the wrapped response object.
+ */
+ public void sendRedirect(String location) throws IOException {
+ response.sendRedirect(location);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setEvent(name, value)</code> on the wrapped response object.
+ */
+ public void setEvent(QName name, Object value) {
+ response.setEvent(name, value);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setEvents(events)</code> on the wrapped response object.
+ */
+ public void setEvents(Map events) {
+ response.setEvents(events);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setPortletMode(portletMode)</code> on the wrapped response object.
+ */
+ public void setPortletMode(PortletMode portletMode)
+ throws PortletModeException {
+ response.setPortletMode(portletMode);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setRenderParameter(key, value)</code> on the wrapped response object.
+ */
+ public void setRenderParameter(String key, String value) {
+ response.setRenderParameter(key, value);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setRenderParameter(key, value)</code> on the wrapped response object.
+ */
+ public void setRenderParameter(String key, String[] values) {
+ response.setRenderParameter(key, values);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setRenderParameters(parameters)</code> on the wrapped response object.
+ */
+ public void setRenderParameters(Map parameters) {
+ response.setRenderParameters(parameters);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setWindowState(windowState)</code> on the wrapped response object.
+ */
+ public void setWindowState(WindowState windowState)
+ throws WindowStateException {
+ response.setWindowState(windowState);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getPortletMode()</code> on the wrapped response object.
+ */
+ public PortletMode getPortletMode() {
+ return response.getPortletMode();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getRenderParameterMap()</code> on the wrapped response object.
+ */
+ public Map getRenderParameterMap() {
+ return response.getRenderParameterMap();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getWindowState()</code> on the wrapped response object.
+ */
+ public WindowState getWindowState() {
+ return response.getWindowState();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setRenderParameters()</code> on the wrapped response object.
+ */
+ public void setRenderParameters(FragmentRequest request) {
+ response.setRenderParameters(request);
+ }
+
+ /**
+ * 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);
+ }
+
+}
Added: 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=auto&rev=529986
==============================================================================
--- portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/RenderFilter.java (added)
+++ portals/pluto/branches/1.1-286-COMPATIBILITY/portlet2-api/src/main/java/javax/portlet/filter/RenderFilter.java Wed Apr 18 04:30:37 2007
@@ -0,0 +1,152 @@
+/* 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 java.io.IOException;
+
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+
+/**
+ * The <code>RenderFilter</code> is an object that performs filtering
+ * tasks on either the render request to a portlet, or on the render response from
+ * a portlet, or both.
+ * <p>
+ * Filters perform filtering in the <code>doFilter</code> method. Every Filter has
+ * access to a <code>FilterConfig</code> object from which it can obtain
+ * its initialization parameters, a reference to the PortletContext
+ * which it can use, for example, to load resources needed for filtering tasks.
+ * <p>
+ * Filters are configured in the portlet deployment descriptor of a
+ * portlet application.
+ *
+ * @since 2.0
+ */
+public interface RenderFilter {
+
+ /**
+ * 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
+ * at the end of the chain.
+ * <p>
+ * The <code>FilterChain</code> passed in to this method allows
+ * the Filter to pass on the render request and response to the next
+ * component in the chain.
+ * <p>
+ * The <code>doFilter</code> method of a filter will typically be implemented
+ * following this or some subset of the following pattern:
+ * <ul>
+ * <li>The method examines the request information.</li>
+ * <li>The method may wrap the request object passed in to
+ * its doFilter method with a customized implementation
+ * the request wrapper <code>RenderRequestWrapper</code>
+ * in order to modify request data.</li>
+ * <li>The method may wrap the response object passed in to its
+ * <code>doFilter</code> method with a customized implementation
+ * of the response wrapper <code>RenderResponseWrapper</code>
+ * to modify response data.</li>
+ * <li>The filter may invoke the next comonent in the filter chain.
+ * The next component may be another filter, or if the filter
+ * making the invocation is the last filter configured in the
+ * deployment descriptor for this chain, the next component
+ * is the target method of the portlet. The invocation of the
+ * next component is effected by calling the <code>doFilter>/code>
+ * method on the <code>FilterChain</code> object, and passing in
+ * the request and response with which it was called or passing
+ * in wrapped versions it may have created.
+ * The filter chains implementation of the <code>doFilter</code>
+ * method, provided by the portlet container, must locate the
+ * next component in the filter chain and invoke its <code>doFilter</code>
+ * method, passing in the appropriate request and response objects.
+ * Alternatively, the filter chain can block the request by not
+ * making the call to invoke the next component, leaving the filter
+ * responsible for filling out the response object.</li>
+ * <li>After invocation of the next filter in the chain, the filter
+ * may examine the response data.</li>
+ * <li>Alternatively, the filter may have thrown an exception to
+ * indicate an error in processing. If the filter throws an
+ * <code>UnavailableException</code> during its <code>doFilter</code>
+ * processing, the portlet container must not attempt continued
+ * processing down the filter chain. It may choose to retry the
+ * whole chain at a later time if the exception is not marked permanent.</li>
+ * <li>When the last filter in the chain has been invoked, the next
+ * component accessed is the target method on the portlet at
+ * the end of the chain.</li>
+ * </ul>
+ *
+ * @param request the current render request
+ * @param response the current render response
+ * @param chain the remaining filter chain
+ * @throws IOException if an IO error occured in the filter processing
+ * @throws PortletException if a portlet exception occured in the filter processing
+ */
+ 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();
+
+}