From: markt Date: Mon, 22 Dec 2008 21:12:27 +0000 (+0000) Subject: Fix performance aspects of 46304. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=8851d1baba5df2b7b3179ae637896075dbf83343;p=tomcat7.0 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. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@728776 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/security/SecurityUtil.java b/java/org/apache/catalina/security/SecurityUtil.java index b046a337c..89bef1f14 100644 --- a/java/org/apache/catalina/security/SecurityUtil.java +++ b/java/org/apache/catalina/security/SecurityUtil.java @@ -52,11 +52,15 @@ public final class SecurityUtil{ 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 @@ public final class SecurityUtil{ } 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 @@ public final class SecurityUtil{ throws Exception{ if ( methodsCache == null){ - methodsCache = new Method[3]; + methodsCache = new Method[4]; } Method method = @@ -382,6 +392,10 @@ public final class SecurityUtil{ 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 );