SEC-685: Improvement to Javadoc for FilterChainProxy and changed to use of LinkedHashSet in obtainAllDefinedFilters to guarantee order is preserved.

This commit is contained in:
Luke Taylor 2008-02-26 12:59:33 +00:00
parent af0992b7d1
commit 0f63084afe

View File

@ -78,13 +78,14 @@ import java.util.*;
* javax.servlet.FilterChain)}, in that the remainder of the original or <code>FilterChainProxy</code>-declared filter * javax.servlet.FilterChain)}, in that the remainder of the original or <code>FilterChainProxy</code>-declared filter
* chain will not be called. * chain will not be called.
* *
* <p>It is particularly noted the <code>Filter</code> lifecycle mismatch between the servlet container and IoC * <p>Note the <code>Filter</code> lifecycle mismatch between the servlet container and IoC
* container. As per {@link DelegatingFilterProxy} JavaDocs, we recommend you allow the IoC * container. As described in the {@link DelegatingFilterProxy} JavaDocs, we recommend you allow the IoC
* container to manage lifecycle instead of the servlet container. By default the <code>DelegatingFilterProxy</code> * container to manage lifecycle instead of the servlet container. By default the <code>DelegatingFilterProxy</code>
* will never call this class' {@link #init(FilterConfig)} and {@link #destroy()} methods, meaning each of the filters * will never call this class' {@link #init(FilterConfig)} and {@link #destroy()} methods, which in turns means that
* defined in the filter chain map will not be called. If you do need your filters to be * the corresponding methods on the filter beans managed by this class will never be called. If you do need your filters to be
* initialized and destroyed, please set the <code>lifecycle</code> initialization parameter against the * initialized and destroyed, please set the <tt>targetFilterLifecycle</tt> initialization parameter against the
* <code>DelegatingFilterProxy</code> to specify servlet container lifecycle management. * <code>DelegatingFilterProxy</code> to specify that servlet container lifecycle management should be used. You don't
* need to worry about this in most cases.
* *
* @author Carlos Sanchez * @author Carlos Sanchez
* @author Ben Alex * @author Ben Alex
@ -220,7 +221,7 @@ public class FilterChainProxy implements Filter, InitializingBean, ApplicationCo
* <code>Filter</code> is defined multiples times in the filter chain map) * <code>Filter</code> is defined multiples times in the filter chain map)
*/ */
protected Filter[] obtainAllDefinedFilters() { protected Filter[] obtainAllDefinedFilters() {
Set allFilters = new HashSet(); Set allFilters = new LinkedHashSet();
Iterator it = filterChainMap.values().iterator(); Iterator it = filterChainMap.values().iterator();