From f0ef649651b0f92dcf85ef29d23a30240b12948e Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Tue, 2 Aug 2011 14:27:52 +0900 Subject: [PATCH] trace from context class loader --- .../java/org/xerial/snappy/SnappyLoader.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/xerial/snappy/SnappyLoader.java b/src/main/java/org/xerial/snappy/SnappyLoader.java index a33f801..46f7c6c 100755 --- a/src/main/java/org/xerial/snappy/SnappyLoader.java +++ b/src/main/java/org/xerial/snappy/SnappyLoader.java @@ -82,11 +82,17 @@ import java.util.Properties; */ public class SnappyLoader { - private static boolean isLoaded = false; - private static SnappyNativeAPI api = null; + public static final String KEY_SNAPPY_LIB_PATH = "org.xerial.snappy.lib.path"; + public static final String KEY_SNAPPY_LIB_NAME = "org.xerial.snappy.lib.name"; + public static final String KEY_SNAPPY_TEMPDIR = "org.xerial.snappy.tempdir"; + public static final String KEY_SNAPPY_DISABLE_BUNDLED_LIBS = "org.xerial.snappy.disable.bundled.libs"; + public static final String KEY_SNAPPY_DISABLE_NATIVE_INJECTION = "org.xerial.snappy.disable.inject"; + + private static boolean isLoaded = false; + private static SnappyNativeAPI api = null; private static ClassLoader getRootClassLoader() { - ClassLoader cl = SnappyLoader.class.getClassLoader(); + ClassLoader cl = Thread.currentThread().getContextClassLoader(); while (cl.getParent() != null) { cl = cl.getParent(); } @@ -272,12 +278,6 @@ public class SnappyLoader } } - public static final String KEY_SNAPPY_LIB_PATH = "org.xerial.snappy.lib.path"; - public static final String KEY_SNAPPY_LIB_NAME = "org.xerial.snappy.lib.name"; - public static final String KEY_SNAPPY_TEMPDIR = "org.xerial.snappy.tempdir"; - public static final String KEY_SNAPPY_DISABLE_BUNDLED_LIBS = "org.xerial.snappy.disable.bundled.libs"; - public static final String KEY_SNAPPY_DISABLE_NATIVE_INJECTION = "org.xerial.snappy.disable.inject"; - /** * Computes the MD5 value of the input stream *