Author: remy.maucherat(a)jboss.com
Date: 2009-10-18 12:47:36 -0400 (Sun, 18 Oct 2009)
New Revision: 1207
Modified:
trunk/java/org/apache/catalina/Session.java
trunk/java/org/apache/catalina/core/ApplicationDispatcher.java
trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java
trunk/java/org/apache/catalina/session/StandardSession.java
Log:
- Revert ...
Modified: trunk/java/org/apache/catalina/Session.java
===================================================================
--- trunk/java/org/apache/catalina/Session.java 2009-10-18 15:12:57 UTC (rev 1206)
+++ trunk/java/org/apache/catalina/Session.java 2009-10-18 16:47:36 UTC (rev 1207)
@@ -253,12 +253,6 @@
/**
- * Add context name in which there is an associated session.
- */
- public void addAssociatedSession(String path);
-
-
- /**
* Return the object bound with the specified name to the internal notes
* for this session, or <code>null</code> if no such binding exists.
*
Modified: trunk/java/org/apache/catalina/core/ApplicationDispatcher.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationDispatcher.java 2009-10-18 15:12:57 UTC
(rev 1206)
+++ trunk/java/org/apache/catalina/core/ApplicationDispatcher.java 2009-10-18 16:47:36 UTC
(rev 1207)
@@ -928,7 +928,6 @@
// Compute a crossContext flag
HttpServletRequest hcurrent = (HttpServletRequest) current;
boolean crossContext = false;
- String originalContextPath = null;
if (state.outerRequest instanceof HttpServletRequest) {
HttpServletRequest houterRequest =
(HttpServletRequest) state.outerRequest;
@@ -939,12 +938,9 @@
contextPath = houterRequest.getContextPath();
}
crossContext = !(context.getPath().equals(contextPath));
- if (crossContext && contextPath != null) {
- originalContextPath = (String) contextPath;
- }
}
wrapper = new ApplicationHttpRequest
- (hcurrent, context, crossContext, originalContextPath);
+ (hcurrent, context, crossContext);
} else {
wrapper = new ApplicationRequest(current);
}
Modified: trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java 2009-10-18 15:12:57
UTC (rev 1206)
+++ trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java 2009-10-18 16:47:36
UTC (rev 1207)
@@ -33,11 +33,10 @@
import javax.servlet.http.HttpServletRequestWrapper;
import javax.servlet.http.HttpSession;
-import org.apache.catalina.Container;
import org.apache.catalina.Context;
import org.apache.catalina.Globals;
-import org.apache.catalina.Session;
import org.apache.catalina.Manager;
+import org.apache.catalina.Session;
import org.apache.catalina.util.Enumerator;
import org.apache.catalina.util.RequestUtil;
import org.apache.catalina.util.StringManager;
@@ -96,12 +95,11 @@
* @param request The servlet request being wrapped
*/
public ApplicationHttpRequest(HttpServletRequest request, Context context,
- boolean crossContext, String originalContextPath) {
+ boolean crossContext) {
super(request);
this.context = context;
this.crossContext = crossContext;
- this.originalContextPath = originalContextPath;
setRequest(request);
}
@@ -117,12 +115,6 @@
/**
- * If cross context, the original context path.
- */
- protected String originalContextPath = null;
-
-
- /**
* The context path for this request.
*/
protected String contextPath = null;
@@ -540,25 +532,11 @@
} catch (IOException e) {
// Ignore
}
+ if ((localSession != null) && !localSession.isValid())
+ localSession = null;
if (localSession == null && create) {
localSession =
context.getManager().createSession(other.getId());
- // Associate the two sessions if possible
- if (originalContextPath != null) {
- Container otherContext =
context.getParent().findChild(originalContextPath);
- if (otherContext != null) {
- try {
- Session otherSession =
otherContext.getManager().findSession(other.getId());
- if (otherSession != null) {
-
localSession.setMaxInactiveInterval(otherSession.getMaxInactiveInterval());
-
otherSession.addAssociatedSession(context.getPath());
-
localSession.addAssociatedSession(originalContextPath);
- }
- } catch (Exception e) {
- // Ignore
- }
- }
- }
}
if (localSession != null) {
localSession.access();
Modified: trunk/java/org/apache/catalina/session/StandardSession.java
===================================================================
--- trunk/java/org/apache/catalina/session/StandardSession.java 2009-10-18 15:12:57 UTC
(rev 1206)
+++ trunk/java/org/apache/catalina/session/StandardSession.java 2009-10-18 16:47:36 UTC
(rev 1207)
@@ -263,13 +263,6 @@
protected transient AtomicInteger accessCount = null;
- /**
- * Associated sessions in other contexts.
- */
- protected transient Map<String, Object> associatedSessions = null;
- protected static final Object TOKEN = new Object();
-
-
// ----------------------------------------------------- Session Properties
@@ -498,24 +491,6 @@
expire();
}
- // Expire any associated session
- if (associatedSessions != null) {
- for (String path : associatedSessions.keySet()) {
- Container crossContainer =
manager.getContainer().getParent().findChild(path);
- if (crossContainer != null) {
- Manager crossManager = crossContainer.getManager();
- try {
- Session associatedSession = crossManager.findSession(id);
- if (associatedSession instanceof StandardSession) {
- ((StandardSession) associatedSession).maxInactiveInterval =
interval;
- }
- } catch (Exception e) {
- // Ignore ...
- }
- }
- }
- }
-
}
@@ -678,17 +653,6 @@
/**
- * Add context name in which there is an associated session.
- */
- public void addAssociatedSession(String path) {
- if (associatedSessions == null) {
- associatedSessions = new ConcurrentHashMap<String, Object>();
- }
- associatedSessions.put(path, TOKEN);
- }
-
-
- /**
* Perform the internal processing required to invalidate this session,
* without triggering an exception if the session has already expired.
*
@@ -776,22 +740,6 @@
}
}
- // Expire any associated session
- if (associatedSessions != null) {
- for (String path : associatedSessions.keySet()) {
- Container crossContainer =
manager.getContainer().getParent().findChild(path);
- if (crossContainer != null) {
- Manager crossManager = crossContainer.getManager();
- try {
- Session associatedSession = crossManager.findSession(id);
- associatedSession.expire();
- } catch (Exception e) {
- // Ignore ...
- }
- }
- }
- }
-
// We have completed expire of this session
expiring = false;
@@ -912,7 +860,6 @@
setPrincipal(null);
isNew = false;
isValid = false;
- associatedSessions = null;
manager = null;
}
Show replies by date