diff --git a/fine-druid/src/main/java/com/fr/third/alibaba/druid/util/ClassLoaderFactory.java b/fine-druid/src/main/java/com/fr/third/alibaba/druid/util/ClassLoaderFactory.java new file mode 100644 index 000000000..1a9eb4518 --- /dev/null +++ b/fine-druid/src/main/java/com/fr/third/alibaba/druid/util/ClassLoaderFactory.java @@ -0,0 +1,34 @@ +package com.fr.third.alibaba.druid.util; + +import java.util.ArrayList; +import java.util.List; + +/** + * @deprecated 1.2.9版本已删除,FR的com.fr.data.pool.DataSourceFactory依赖了,实际上没地方用到,为了兼容性暂时不删 + */ +@Deprecated +public class ClassLoaderFactory { + + private static List helpers = new ArrayList(); + + public static void registerCLassLoaderHelper(ClassLoaderHelper helper) { + if(helper != null){ + helpers.add(helper); + } + } + + + public static Class loadClass(String className) throws ClassNotFoundException { + for(ClassLoaderHelper helper : helpers) { + try { + Class clazz = helper.loadClass(className); + if(clazz != null){ + return clazz; + } + } catch (ClassNotFoundException e) { + // skip + } + } + throw new ClassNotFoundException(className); + } +} \ No newline at end of file diff --git a/fine-druid/src/main/java/com/fr/third/alibaba/druid/util/ClassLoaderHelper.java b/fine-druid/src/main/java/com/fr/third/alibaba/druid/util/ClassLoaderHelper.java new file mode 100644 index 000000000..d7372493e --- /dev/null +++ b/fine-druid/src/main/java/com/fr/third/alibaba/druid/util/ClassLoaderHelper.java @@ -0,0 +1,12 @@ +package com.fr.third.alibaba.druid.util; + + +/** + * @deprecated 1.2.9版本已删除,FR的com.fr.data.pool.DataSourceFactory依赖了,实际上没地方用到,为了兼容性暂时不删 + */ +@Deprecated +public interface ClassLoaderHelper { + + Class loadClass(String className) throws ClassNotFoundException; + +} \ No newline at end of file