*/
public boolean isSingleThreadModel() {
+ // Short-cuts
+ // If singleThreadModel is true, must have already checked this
+ // If instance != null, must have already loaded
+ if (singleThreadModel || instance != null) {
+ return singleThreadModel;
+ }
+
+ // The logic to determine this safely is more complex than one might
+ // expect. allocate() already has the necessary logic so re-use it.
try {
- loadServlet();
+ Servlet s = allocate();
+ deallocate(s);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
}
@Override
public String[] getServletMethods() throws ServletException {
- Class<? extends Servlet> servletClazz = loadServlet().getClass();
+ instance = loadServlet();
+
+ Class<? extends Servlet> servletClazz = instance.getClass();
if (!javax.servlet.http.HttpServlet.class.isAssignableFrom(
servletClazz)) {
return DEFAULT_SERVLET_METHODS;
<bug>51588</bug>: Make it easier to extend the AccessLogValve to add
support for custom elements. (markt)
</fix>
+ <fix>
+ Ensure that calls to StandardWrapper methods() that may trigger creation
+ of a Servlet instance always do so in way that correctly instantiates a
+ Servlet instance. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">