Add some comments, changes from code review.

Signed-off-by: Jan Bartel <janb@webtide.com>
This commit is contained in:
Jan Bartel 2017-11-16 10:01:44 +01:00
parent 10a6f57bd8
commit 98d8c2400d
3 changed files with 7 additions and 3 deletions

View File

@ -73,7 +73,7 @@ public class AnnotationConfiguration extends AbstractConfiguration
public static final String CONTAINER_INITIALIZER_STARTER = "org.eclipse.jetty.containerInitializerStarter"; public static final String CONTAINER_INITIALIZER_STARTER = "org.eclipse.jetty.containerInitializerStarter";
public static final String MULTI_THREADED = "org.eclipse.jetty.annotations.multiThreaded"; public static final String MULTI_THREADED = "org.eclipse.jetty.annotations.multiThreaded";
public static final String MAX_SCAN_WAIT = "org.eclipse.jetty.annotations.maxWait"; public static final String MAX_SCAN_WAIT = "org.eclipse.jetty.annotations.maxWait";
public static final String JAVA_TARGET_PLATFORM = JavaVersion.JAVA_TARGET_PLATFORM;
public static final int DEFAULT_MAX_SCAN_WAIT = 60; /* time in sec */ public static final int DEFAULT_MAX_SCAN_WAIT = 60; /* time in sec */
public static final boolean DEFAULT_MULTI_THREADED = true; public static final boolean DEFAULT_MULTI_THREADED = true;
@ -421,7 +421,7 @@ public class AnnotationConfiguration extends AbstractConfiguration
throws Exception throws Exception
{ {
int javaPlatform = 0; int javaPlatform = 0;
Object target = context.getAttribute(JAVA_TARGET_PLATFORM); Object target = context.getAttribute(JavaVersion.JAVA_TARGET_PLATFORM);
if (target!=null) if (target!=null)
javaPlatform = Integer.valueOf(target.toString()); javaPlatform = Integer.valueOf(target.toString());
AnnotationParser parser = createAnnotationParser(javaPlatform); AnnotationParser parser = createAnnotationParser(javaPlatform);

View File

@ -28,6 +28,10 @@ import java.util.regex.Pattern;
public class JavaVersion public class JavaVersion
{ {
/**
* Context attribute that can be set to target a different version of the jvm than the current runtime.
* Acceptable values should correspond to those returned by JavaVersion.getPlatform().
*/
public static final String JAVA_TARGET_PLATFORM = "org.eclipse.jetty.javaTargetPlatform"; public static final String JAVA_TARGET_PLATFORM = "org.eclipse.jetty.javaTargetPlatform";
// Copy of version in jetty-start // Copy of version in jetty-start

View File

@ -226,7 +226,7 @@ public class WebInfConfiguration extends AbstractConfiguration
//if running on jvm 9 or above, we we won't be able to look at the application classloader //if running on jvm 9 or above, we we won't be able to look at the application classloader
//to extract urls, so we need to examine the classpath instead. //to extract urls, so we need to examine the classpath instead.
if (JavaVersion.VERSION.getMajor() >= 9) if (JavaVersion.VERSION.getPlatform() >= 9)
{ {
tmp = System.getProperty("java.class.path"); tmp = System.getProperty("java.class.path");
if (tmp != null) if (tmp != null)