You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sk...@apache.org on 2007/08/17 11:38:37 UTC
svn commit: r566982 -
/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/requestParameterProvider/RequestParameterProviderManager.java
Author: skitching
Date: Fri Aug 17 02:38:36 2007
New Revision: 566982
URL: http://svn.apache.org/viewvc?view=rev&rev=566982
Log:
Make log object non-static.
Add javadoc and comments.
Modified:
myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/requestParameterProvider/RequestParameterProviderManager.java
Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/requestParameterProvider/RequestParameterProviderManager.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/requestParameterProvider/RequestParameterProviderManager.java?view=diff&rev=566982&r1=566981&r2=566982
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/requestParameterProvider/RequestParameterProviderManager.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/requestParameterProvider/RequestParameterProviderManager.java Fri Aug 17 02:38:36 2007
@@ -19,26 +19,44 @@
package org.apache.myfaces.orchestra.requestParameterProvider;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter;
-
import java.io.Serializable;
+import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import java.util.ArrayList;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter;
/**
- * The manager which manage all the attached providers and add their fields to the url
+ * The manager which manage all the attached providers and add their fields to the url.
+ * <p>
+ * This class has an instance per user http session. Code that wishes to add values
+ * to urls generated within pages register a "provider" with this object. When request
+ * params need to be output this manager invokes each provider in turn.
+ * <p>
+ * If the data accessed by a registered "provider" has scope shorter than an http session
+ * then the registered provider should obviously be <i>deregistered</i> when the data
+ * is no longer valid.
+ * <p>
+ * This class works together with the RequestParameterServletFilter and
+ * RequestParameterResponseWrapper so that every call to response.encodeURL(...) gets
+ * forwarded to this class. As encodeURL is used by JSF commandButton, commandLink, etc,
+ * this ensures that whatever the user clicks on the parameters provided by the
+ * registered provider objects are present on the next JSF request.
*/
public class RequestParameterProviderManager implements Serializable
{
- private static final Log LOG = LogFactory.getLog(RequestParameterProviderManager.class);
+ private final Log LOG = LogFactory.getLog(RequestParameterProviderManager.class);
private static final String PAGE_PARAMETER_SEP = "?";
private static final String PARAMETER_SEP = "&";
private static final String PARAMETER_PROVIDER_MANAGER_KEY = RequestParameterProviderManager.class.getName();
+ // TODO: investigate why this is transient. At least some callers of register call
+ // it only once per session, so if the session data is passed to another machine or is
+ // saved then restored then it seems the registered providers will be lost when they
+ // should not be...
private transient List providers;
private RequestParameterProviderManager()