use of com.navercorp.pinpoint.common.util.JvmVersion in project pinpoint by naver.
the class DefaultApplicationContext method lambdaFactorySetup.
private void lambdaFactorySetup(Instrumentation instrumentation, ClassFileTransformModuleAdaptor classFileTransformer, JavaModuleFactory javaModuleFactory) {
final JvmVersion version = JvmUtils.getVersion();
// TODO version.onOrAfter(JvmVersion.JAVA_8)
if (version.onOrAfter(JvmVersion.JAVA_9)) {
LambdaTransformBootloader lambdaTransformBootloader = new LambdaTransformBootloader();
lambdaTransformBootloader.transformLambdaFactory(instrumentation, classFileTransformer, javaModuleFactory);
}
}
use of com.navercorp.pinpoint.common.util.JvmVersion in project pinpoint by naver.
the class JavaVersionFilter method accept.
@Override
public boolean accept(PluginJar pluginJar) {
String pluginId = pluginJar.getPluginId();
if (pluginId == null) {
logger.warn("Invalid plugin : {}, missing manifest entry : {}", pluginJar.getJarFile().getName(), PluginJar.PINPOINT_PLUGIN_ID);
return REJECT;
}
String pluginCompilerVersion = pluginJar.getPluginCompilerVersion();
if (pluginCompilerVersion == null) {
logger.info("Skipping {} due to missing manifest entry : {}", pluginJar.getJarFile().getName(), PluginJar.PINPOINT_PLUGIN_COMPILER_VERSION);
return REJECT;
}
JvmVersion pluginJvmVersion = JvmVersion.getFromVersion(pluginCompilerVersion);
if (pluginJvmVersion == JvmVersion.UNSUPPORTED) {
logger.info("Skipping {} due to unknown plugin compiler version : {}", pluginId, pluginCompilerVersion);
return REJECT;
}
if (jvmVersion.onOrAfter(pluginJvmVersion)) {
return ACCEPT;
}
logger.info("Skipping {} due to java version. Required : {}, found : {}", pluginId, pluginJvmVersion, jvmVersion);
return REJECT;
}
use of com.navercorp.pinpoint.common.util.JvmVersion in project pinpoint by naver.
the class JvmVersionTest method testGetFromDoubleVersion.
@Test
public void testGetFromDoubleVersion() {
// JDK 5
final JvmVersion java_5 = JvmVersion.getFromVersion(1.5);
assertSame(java_5, JAVA_5);
// JDK 6
final JvmVersion java_6 = JvmVersion.getFromVersion(1.6);
assertSame(java_6, JAVA_6);
// JDK 7
final JvmVersion java_7 = JvmVersion.getFromVersion(1.7);
assertSame(java_7, JAVA_7);
// JDK 8
final JvmVersion java_8 = JvmVersion.getFromVersion(1.8);
assertSame(java_8, JAVA_8);
// Unsupported
final JvmVersion java_unsupported = JvmVersion.getFromVersion(0.9);
assertSame(java_unsupported, UNSUPPORTED);
}
use of com.navercorp.pinpoint.common.util.JvmVersion in project pinpoint by naver.
the class JvmVersionTest method testGetFromStringVersion.
@Test
public void testGetFromStringVersion() {
// JDK 5
final JvmVersion java_5 = JvmVersion.getFromVersion("1.5");
assertSame(java_5, JAVA_5);
// JDK 6
final JvmVersion java_6 = JvmVersion.getFromVersion("1.6");
assertSame(java_6, JAVA_6);
// JDK 7
final JvmVersion java_7 = JvmVersion.getFromVersion("1.7");
assertSame(java_7, JAVA_7);
// JDK 8
final JvmVersion java_8 = JvmVersion.getFromVersion("1.8");
assertSame(java_8, JAVA_8);
// Unsupported
final JvmVersion java_unsupported = JvmVersion.getFromVersion("abc");
assertSame(java_unsupported, UNSUPPORTED);
}
use of com.navercorp.pinpoint.common.util.JvmVersion in project pinpoint by naver.
the class JvmVersionTest method testGetFromClassVersion.
@Test
public void testGetFromClassVersion() {
// JDK 5
final JvmVersion java_5 = JvmVersion.getFromClassVersion(49);
assertSame(java_5, JAVA_5);
// JDK 6
final JvmVersion java_6 = JvmVersion.getFromClassVersion(50);
assertSame(java_6, JAVA_6);
// JDK 7
final JvmVersion java_7 = JvmVersion.getFromClassVersion(51);
assertSame(java_7, JAVA_7);
// JDK 8
final JvmVersion java_8 = JvmVersion.getFromClassVersion(52);
assertSame(java_8, JAVA_8);
// Unsupported
final JvmVersion java_unsupported = JvmVersion.getFromClassVersion(-1);
assertSame(java_unsupported, UNSUPPORTED);
}
Aggregations