提交 61d79760 编写于 作者: A ascrutae

Merge remote-tracking branch 'origin/master'

......@@ -25,15 +25,16 @@ public class InterceptorInstanceLoader {
public static <T> T load(String className, ClassLoader targetClassLoader)
throws InvocationTargetException, IllegalAccessException, InstantiationException, ClassNotFoundException {
if (InterceptorInstanceLoader.class.getClassLoader().equals(targetClassLoader)) {
return (T) targetClassLoader.loadClass(className).newInstance();
}
String instanceKey = className + "_OF_" + targetClassLoader.getClass().getName() + "@" + Integer.toHexString(targetClassLoader.hashCode());
Object inst = INSTANCE_CACHE.get(instanceKey);
if (inst != null) {
return (T) inst;
}
if (InterceptorInstanceLoader.class.getClassLoader().equals(targetClassLoader)) {
return (T) targetClassLoader.loadClass(className).newInstance();
}
instanceLoadLock.lock();
try {
try {
......@@ -49,9 +50,7 @@ public class InterceptorInstanceLoader {
} catch (Exception e) {
throw new ClassNotFoundException(targetClassLoader.toString() + " load interceptor class:" + className + " failure.", e);
}
} finally
{
} finally {
instanceLoadLock.unlock();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册