You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@apache.org on 2002/06/20 20:53:44 UTC
cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java
costin 2002/06/20 11:53:44
Modified: coyote/src/java/org/apache/coyote ActionCode.java
coyote/src/java/org/apache/coyote/tomcat3
CoyoteInterceptor2.java
coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java
Log:
Added a new ActionCode, to be called after the request.
Added the calls to the POST_REQUEST action code.
It can be used for cleanup and logging ( and timings )
This is called _before_ the request is recycled, so both req and res
should be valid ( and you can get the uri and lengths )
Revision Changes Path
1.8 +8 -1 jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/ActionCode.java
Index: ActionCode.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/ActionCode.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ActionCode.java 17 May 2002 19:49:03 -0000 1.7
+++ ActionCode.java 20 Jun 2002 18:53:44 -0000 1.8
@@ -79,7 +79,8 @@
public static final ActionCode ACTION_COMMIT = new ActionCode();
- /* A flush() operation originated by the client
+ /* A flush() operation originated by the client ( i.e. a flush() on
+ the servlet output stream or writer, called by a servlet ).
*/
public static final ActionCode ACTION_CLIENT_FLUSH = new ActionCode();
@@ -97,6 +98,12 @@
public static final ActionCode ACTION_WEBAPP = new ActionCode();
+
+ /** Hook called after request, but before recycling. Can be used
+ for logging, to update counters, custom cleanup - the request
+ is still visible
+ */
+ public static final ActionCode ACTION_POST_REQUEST = new ActionCode();
/**
* Callback for lazy evaluation - extract the remote host address.
1.12 +13 -0 jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat3/CoyoteInterceptor2.java
Index: CoyoteInterceptor2.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat3/CoyoteInterceptor2.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- CoyoteInterceptor2.java 1 Jun 2002 05:14:02 -0000 1.11
+++ CoyoteInterceptor2.java 20 Jun 2002 18:53:44 -0000 1.12
@@ -205,6 +205,19 @@
return 0;
}
+ public int postRequest(org.apache.tomcat.core.Request request,
+ org.apache.tomcat.core.Response response) {
+ if(request instanceof Tomcat3Request) {
+ try {
+ Tomcat3Request httpReq=(Tomcat3Request)request;
+ org.apache.coyote.Request cReq = httpReq.getCoyoteRequest();
+ cReq.action( ActionCode.ACTION_POST_REQUEST , null);
+ } catch(Exception ex) {
+ log("Can't send ACK", ex);
+ }
+ }
+ return 0;
+ }
/**
getInfo calls for SSL data
1.8 +6 -4 jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
Index: CoyoteAdapter.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- CoyoteAdapter.java 28 May 2002 14:24:31 -0000 1.7
+++ CoyoteAdapter.java 20 Jun 2002 18:53:44 -0000 1.8
@@ -222,6 +222,8 @@
// Calling the container
connector.getContainer().invoke(request, response);
response.finishResponse();
+
+ req.action( ActionCode.ACTION_POST_REQUEST , null);
} catch (IOException e) {
;
} catch (Throwable t) {
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>