File tree Expand file tree Collapse file tree 3 files changed +7
-8
lines changed
core/src/main/java/com/dtstack/flink/sql/classloader Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 2626import java .net .URL ;
2727import java .util .ArrayList ;
2828import java .util .Arrays ;
29- import java .util .Collections ;
3029import java .util .Comparator ;
3130import java .util .List ;
3231import java .util .Map ;
@@ -43,14 +42,14 @@ public class ClassLoaderManager {
4342
4443 private static Map <String , DtClassLoader > pluginClassLoader = new ConcurrentHashMap <>();
4544
46- public static <R > R newInstance (String pluginJarPath , DtSupplier <R > supplier ) throws Exception {
45+ public static <R > R newInstance (String pluginJarPath , ClassLoaderSupplier <R > supplier ) throws Exception {
4746 ClassLoader classLoader = retrieveClassLoad (pluginJarPath );
48- return ClassLoaderCallBackMethod .callbackAndReset (supplier , classLoader );
47+ return ClassLoaderSupplierCallBack .callbackAndReset (supplier , classLoader );
4948 }
5049
51- public static <R > R newInstance (List <URL > jarUrls , DtSupplier <R > supplier ) throws Exception {
50+ public static <R > R newInstance (List <URL > jarUrls , ClassLoaderSupplier <R > supplier ) throws Exception {
5251 ClassLoader classLoader = retrieveClassLoad (jarUrls );
53- return ClassLoaderCallBackMethod .callbackAndReset (supplier , classLoader );
52+ return ClassLoaderSupplierCallBack .callbackAndReset (supplier , classLoader );
5453 }
5554
5655 private static DtClassLoader retrieveClassLoad (String pluginJarPath ) {
Original file line number Diff line number Diff line change 3333 * @since 1.8
3434 */
3535@ FunctionalInterface
36- public interface DtSupplier <T > {
36+ public interface ClassLoaderSupplier <T > {
3737
3838 /**
3939 * Gets a result.
Original file line number Diff line number Diff line change 2424 * author: toutian
2525 * create: 2019/10/14
2626 */
27- public class ClassLoaderCallBackMethod {
27+ public class ClassLoaderSupplierCallBack {
2828
29- public static <R > R callbackAndReset (DtSupplier <R > supplier , ClassLoader toSetClassLoader ) throws Exception {
29+ public static <R > R callbackAndReset (ClassLoaderSupplier <R > supplier , ClassLoader toSetClassLoader ) throws Exception {
3030 ClassLoader oldClassLoader = Thread .currentThread ().getContextClassLoader ();
3131 Thread .currentThread ().setContextClassLoader (toSetClassLoader );
3232 try {
You can’t perform that action at this time.
0 commit comments