Merge remote-tracking branch 'origin/jetty-9.4.x'

This commit is contained in:
Greg Wilkins 2017-09-23 09:22:41 +10:00
commit 6ef618e8cf
2 changed files with 46 additions and 16 deletions

View File

@ -116,6 +116,26 @@
<artifactId>jetty-alpn-java-server</artifactId> <artifactId>jetty-alpn-java-server</artifactId>
<version>10.0.0-SNAPSHOT</version> <version>10.0.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-alpn-openjdk8-client</artifactId>
<version>9.4.8-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-alpn-openjdk8-server</artifactId>
<version>9.4.8-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-alpn-conscrypt-client</artifactId>
<version>9.4.8-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-alpn-conscrypt-server</artifactId>
<version>9.4.8-SNAPSHOT</version>
</dependency>
<dependency> <dependency>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-alpn-server</artifactId> <artifactId>jetty-alpn-server</artifactId>

View File

@ -81,11 +81,11 @@ public class ServletHolder extends Holder<Servlet> implements UserIdentity.Scope
private ServletRegistration.Dynamic _registration; private ServletRegistration.Dynamic _registration;
private JspContainer _jspContainer; private JspContainer _jspContainer;
private transient Servlet _servlet; private Servlet _servlet;
private transient Config _config; private long _unavailable;
private transient long _unavailable; private Config _config;
private transient boolean _enabled = true; private boolean _enabled = true;
private transient UnavailableException _unavailableEx; private UnavailableException _unavailableEx;
public static final String APACHE_SENTINEL_CLASS = "org.apache.tomcat.InstanceManager"; public static final String APACHE_SENTINEL_CLASS = "org.apache.tomcat.InstanceManager";
@ -773,14 +773,23 @@ public class ServletHolder extends Holder<Servlet> implements UserIdentity.Scope
baseRequest.setAttribute(Request.__MULTIPART_CONFIG_ELEMENT, mpce); baseRequest.setAttribute(Request.__MULTIPART_CONFIG_ELEMENT, mpce);
} }
public synchronized Servlet ensureInstance() public Servlet ensureInstance()
throws ServletException, UnavailableException throws ServletException, UnavailableException
{ {
if (_class==null)
throw new UnavailableException("Servlet Not Initialized");
Servlet servlet=_servlet;
if (!isStarted()) if (!isStarted())
throw new UnavailableException("Servlet not initialized", -1); throw new UnavailableException("Servlet not initialized", -1);
Servlet servlet=_servlet;
if (servlet!=null && _unavailable==0)
return servlet;
synchronized(this)
{
servlet=_servlet;
if (servlet!=null)
return servlet;
if (_class == null)
throw new UnavailableException("Servlet Not Initialized");
if (_unavailable != 0 || (!_initOnStartup && servlet == null)) if (_unavailable != 0 || (!_initOnStartup && servlet == null))
servlet = getServlet(); servlet = getServlet();
if (servlet == null) if (servlet == null)
@ -788,6 +797,7 @@ public class ServletHolder extends Holder<Servlet> implements UserIdentity.Scope
return servlet; return servlet;
} }
}
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**