remm 2003/01/30 10:22:58
Modified: coyote/src/java/org/apache/coyote/tomcat5 CoyoteRequest.java
Log:
- Add optimized processing for request dispatcher state (which are done using
Catalina proprietary request attributes).
- No notifications will be sent for these attributes changes to listeners (if that's
contrary to the spec, let me know; it looks ok as these are proprietary
internal attributes).
Revision Changes Path
1.20 +34 -4
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5/CoyoteRequest.java
Index: CoyoteRequest.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5/CoyoteRequest.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- CoyoteRequest.java 30 Jan 2003 14:22:15 -0000 1.19
+++ CoyoteRequest.java 30 Jan 2003 18:22:58 -0000 1.20
@@ -242,6 +242,12 @@
/**
+ * The current dispatcher type.
+ */
+ protected Object dispatcherType = null;
+
+
+ /**
* The associated input buffer.
*/
protected InputBuffer inputBuffer = new InputBuffer();
@@ -316,6 +322,12 @@
/**
+ * The current request dispatcher path.
+ */
+ protected Object requestDispatcherPath = null;
+
+
+ /**
* Was the requested session ID received in a cookie?
*/
protected boolean requestedSessionCookie = false;
@@ -375,6 +387,9 @@
context = null;
wrapper = null;
+ dispatcherType = null;
+ requestDispatcherPath = null;
+
authType = null;
inputBuffer.recycle();
usingInputStream = false;
@@ -870,6 +885,13 @@
* @param name Name of the request attribute to return
*/
public Object getAttribute(String name) {
+
+ if (name.equals(Globals.DISPATCHER_TYPE_ATTR)) {
+ return dispatcherType;
+ } else if (name.equals(Globals.DISPATCHER_REQUEST_PATH_ATTR)) {
+ return requestDispatcherPath.toString();
+ }
+
Object attr=attributes.get(name);
if(attr!=null)
@@ -1281,6 +1303,14 @@
// Null value is the same as removeAttribute()
if (value == null) {
removeAttribute(name);
+ return;
+ }
+
+ if (name.equals(Globals.DISPATCHER_TYPE_ATTR)) {
+ dispatcherType = value;
+ return;
+ } else if (name.equals(Globals.DISPATCHER_REQUEST_PATH_ATTR)) {
+ requestDispatcherPath = value;
return;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]