warning if not stable release

This commit is contained in:
Greg Wilkins 2016-04-28 08:15:06 +10:00
parent 695b63fc78
commit 5f7a32e30e
2 changed files with 12 additions and 0 deletions

View File

@ -343,6 +343,9 @@ public class Server extends HandlerWrapper implements Attributes
ShutdownMonitor.getInstance().start(); // initialize
LOG.info("jetty-" + getVersion());
if (!Jetty.STABLE)
LOG.warn("THIS IS NOT A STABLE RELEASE! DO NOT USE IN PRODUCTION!");
HttpGenerator.setJettyVersion(HttpConfiguration.SERVER_VERSION);
MultiException mex=new MultiException();

View File

@ -22,6 +22,7 @@ public class Jetty
{
public static final String VERSION;
public static final String POWERED_BY;
public static final boolean STABLE;
static
{
@ -34,6 +35,14 @@ public class Jetty
VERSION = System.getProperty("jetty.version", "9.3.z-SNAPSHOT");
POWERED_BY="<a href=\"http://eclipse.org/jetty\">Powered by Jetty:// "+VERSION+"</a>";
boolean stable=true;
for (char c: VERSION.toCharArray())
{
if (c!='.' && !Character.isDigit(c))
stable=false;
}
STABLE=stable;
}
private Jetty()