Fixes 338068 (Leaking ConstraintMappings on redeploy).

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@2829 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Simone Bordet 2011-02-24 11:21:33 +00:00
parent 42d8d84239
commit f5cb64ff54
2 changed files with 43 additions and 43 deletions

View File

@ -22,6 +22,7 @@ jetty-7.3.1-SNAPSHOT
+ JETTY-1331 Allow alternate XML configuration processors (eg spring)
+ JETTY-1335 HttpClient's SelectConnector clean-up
+ JETTY-1333 HttpClient _timeout and _soTimeout is messed up
+ 338068 Leaking ConstraintMappings on redeploy
jetty-7.3.0.v20110203 3 February 2011
+ JETTY-1259 NullPointerException in JDBCSessionIdManager when invalidating session (further update)

View File

@ -14,7 +14,6 @@
package org.eclipse.jetty.security;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
@ -31,10 +30,7 @@ import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.HttpConnection;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Response;
import org.eclipse.jetty.server.SessionManager;
import org.eclipse.jetty.server.UserIdentity;
import org.eclipse.jetty.server.handler.ContextHandler;
import org.eclipse.jetty.server.session.SessionHandler;
import org.eclipse.jetty.util.StringMap;
import org.eclipse.jetty.util.TypeUtil;
@ -51,8 +47,6 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
private final Set<String> _roles = new CopyOnWriteArraySet<String>();
private final PathMap _constraintMap = new PathMap();
private boolean _strict = true;
private SessionHandler _sessionHandler;
/* ------------------------------------------------------------ */
/** Get the strict mode.
@ -86,7 +80,7 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
/* ------------------------------------------------------------ */
/**
* @return Returns the contraintMappings.
* @return Returns the constraintMappings.
*/
public List<ConstraintMapping> getConstraintMappings()
{
@ -105,7 +99,7 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
* spec section 13.7.1 Note that much of the logic is in the RoleInfo class.
*
* @param constraintMappings
* The contraintMappings to set, from which the set of known roles
* The constraintMappings to set, from which the set of known roles
* is determined.
*/
public void setConstraintMappings(List<ConstraintMapping> constraintMappings)
@ -118,7 +112,7 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
* spec section 13.7.1 Note that much of the logic is in the RoleInfo class.
*
* @param constraintMappings
* The contraintMappings to set as array, from which the set of known roles
* The constraintMappings to set as array, from which the set of known roles
* is determined. Needed to retain API compatibility for 7.x
*/
public void setConstraintMappings( ConstraintMapping[] constraintMappings )
@ -132,7 +126,7 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
* spec section 13.7.1 Note that much of the logic is in the RoleInfo class.
*
* @param constraintMappings
* The contraintMappings to set.
* The constraintMappings to set.
* @param roles The known roles (or null to determine them from the mappings)
*/
public void setConstraintMappings(List<ConstraintMapping> constraintMappings, Set<String> roles)
@ -191,7 +185,7 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
if (isStarted())
{
processContraintMapping(mapping);
processConstraintMapping(mapping);
}
}
@ -228,17 +222,22 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
{
for (ConstraintMapping mapping : _constraintMappings)
{
processContraintMapping(mapping);
processConstraintMapping(mapping);
}
}
if (ContextHandler.getCurrentContext()!=null)
_sessionHandler = ContextHandler.getCurrentContext().getContextHandler().getNestedHandlerByClass(SessionHandler.class);
super.doStart();
}
protected void processContraintMapping(ConstraintMapping mapping)
@Override
protected void doStop() throws Exception
{
_constraintMap.clear();
_constraintMappings.clear();
_roles.clear();
super.doStop();
}
protected void processConstraintMapping(ConstraintMapping mapping)
{
Map<String, RoleInfo> mappings = (Map<String, RoleInfo>)_constraintMap.get(mapping.getPathSpec());
if (mappings == null)