rinoux
3 years ago
2 changed files with 46 additions and 0 deletions
@ -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<ClassLoaderHelper> helpers = new ArrayList<ClassLoaderHelper>(); |
||||
|
||||
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); |
||||
} |
||||
} |
@ -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; |
||||
|
||||
} |
Loading…
Reference in new issue