You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2008/12/22 22:12:27 UTC

svn commit: r728776 - /tomcat/trunk/java/org/apache/catalina/security/SecurityUtil.java

Author: markt
Date: Mon Dec 22 13:12:27 2008
New Revision: 728776

URL: http://svn.apache.org/viewvc?rev=728776&view=rev
Log:
Fix performance aspects of 46304.
Note it is possible (depending on connector config) to have a servlet/filter responding to comet and non-comet events - hence why the array used in the methods cache has been extended.

Modified:
    tomcat/trunk/java/org/apache/catalina/security/SecurityUtil.java

Modified: tomcat/trunk/java/org/apache/catalina/security/SecurityUtil.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/security/SecurityUtil.java?rev=728776&r1=728775&r2=728776&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/security/SecurityUtil.java (original)
+++ tomcat/trunk/java/org/apache/catalina/security/SecurityUtil.java Mon Dec 22 13:12:27 2008
@@ -52,11 +52,15 @@
     private final static int INIT= 0;
     private final static int SERVICE = 1;
     private final static int DOFILTER = 1;
-    private final static int DESTROY = 2;
+    private final static int EVENT = 2;
+    private final static int DOFILTEREVENT = 2;
+    private final static int DESTROY = 3;
     
     private final static String INIT_METHOD = "init";
     private final static String DOFILTER_METHOD = "doFilter";
     private final static String SERVICE_METHOD = "service";
+    private final static String EVENT_METHOD = "event";
+    private final static String DOFILTEREVENT_METHOD = "doFilterEvent";
     private final static String DESTROY_METHOD = "destroy";
    
     /**
@@ -346,6 +350,12 @@
         } else if (methodName.equalsIgnoreCase(DOFILTER_METHOD) 
                 && methodsCache[DOFILTER] != null){
             return methodsCache[DOFILTER];          
+        } else if (methodName.equalsIgnoreCase(EVENT_METHOD) 
+                && methodsCache[EVENT] != null){
+            return methodsCache[EVENT];          
+        } else if (methodName.equalsIgnoreCase(DOFILTEREVENT_METHOD) 
+                && methodsCache[DOFILTEREVENT] != null){
+            return methodsCache[DOFILTEREVENT];          
         } 
         return null;
     }
@@ -368,7 +378,7 @@
             throws Exception{
         
         if ( methodsCache == null){
-            methodsCache = new Method[3];
+            methodsCache = new Method[4];
         }               
                 
         Method method = 
@@ -382,6 +392,10 @@
             methodsCache[SERVICE] = method;
         } else if (methodName.equalsIgnoreCase(DOFILTER_METHOD)){
             methodsCache[DOFILTER] = method;
+        } else if (methodName.equalsIgnoreCase(EVENT_METHOD)){
+            methodsCache[EVENT] = method;
+        } else if (methodName.equalsIgnoreCase(DOFILTEREVENT_METHOD)){
+            methodsCache[DOFILTEREVENT] = method;
         } 
          
         objectCache.put(targetObject, methodsCache );



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org