Lines 35-40
Link Here
|
35 |
import javax.servlet.http.HttpSession; |
35 |
import javax.servlet.http.HttpSession; |
36 |
|
36 |
|
37 |
import org.apache.catalina.Globals; |
37 |
import org.apache.catalina.Globals; |
|
|
38 |
import org.apache.catalina.comet.CometProcessor; |
38 |
import org.apache.tomcat.util.ExceptionUtils; |
39 |
import org.apache.tomcat.util.ExceptionUtils; |
39 |
import org.apache.tomcat.util.res.StringManager; |
40 |
import org.apache.tomcat.util.res.StringManager; |
40 |
/** |
41 |
/** |
Lines 148-165
Link Here
|
148 |
Principal principal) |
149 |
Principal principal) |
149 |
throws java.lang.Exception{ |
150 |
throws java.lang.Exception{ |
150 |
|
151 |
|
|
|
152 |
// CometProcessor servlets must not be cached as Servlet or NoSuchMethodException will be thrown. |
153 |
Class<?> targetType = targetObject instanceof CometProcessor ? CometProcessor.class : Servlet.class; |
154 |
|
151 |
Method method = null; |
155 |
Method method = null; |
152 |
Method[] methodsCache = classCache.get(Servlet.class); |
156 |
|
|
|
157 |
Method[] methodsCache = classCache.get(targetType); |
153 |
if(methodsCache == null) { |
158 |
if(methodsCache == null) { |
154 |
method = createMethodAndCacheIt(methodsCache, |
159 |
method = createMethodAndCacheIt(methodsCache, |
155 |
Servlet.class, |
160 |
targetType, |
156 |
methodName, |
161 |
methodName, |
157 |
targetParameterTypes); |
162 |
targetParameterTypes); |
158 |
} else { |
163 |
} else { |
159 |
method = findMethod(methodsCache, methodName); |
164 |
method = findMethod(methodsCache, methodName); |
160 |
if (method == null) { |
165 |
if (method == null) { |
161 |
method = createMethodAndCacheIt(methodsCache, |
166 |
method = createMethodAndCacheIt(methodsCache, |
162 |
Servlet.class, |
167 |
targetType, |
163 |
methodName, |
168 |
methodName, |
164 |
targetParameterTypes); |
169 |
targetParameterTypes); |
165 |
} |
170 |
} |
Lines 253-259
Link Here
|
253 |
* Perform work as a particular </code>Subject</code>. Here the work |
258 |
* Perform work as a particular </code>Subject</code>. Here the work |
254 |
* will be granted to a <code>null</code> subject. |
259 |
* will be granted to a <code>null</code> subject. |
255 |
* |
260 |
* |
256 |
* @param methodName the method to apply the security restriction |
261 |
* @param method the method to apply the security restriction |
257 |
* @param targetObject the <code>Servlet</code> on which the method will |
262 |
* @param targetObject the <code>Servlet</code> on which the method will |
258 |
* be called. |
263 |
* be called. |
259 |
* @param targetArguments <code>Object</code> array contains the |
264 |
* @param targetArguments <code>Object</code> array contains the |