|
|
|
@ -13,6 +13,7 @@ import com.fr.function.SUM;
|
|
|
|
|
import com.fr.function.TIME; |
|
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
|
|
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
import com.fr.plugin.ExtraClassManager; |
|
|
|
|
import com.fr.stable.EncodeConstants; |
|
|
|
|
import com.fr.stable.OperatingSystem; |
|
|
|
@ -225,7 +226,14 @@ public abstract class FunctionConstants {
|
|
|
|
|
String pkgName = "com.fr.function"; |
|
|
|
|
Class<Function> iface = Function.class; |
|
|
|
|
ClassLoader classloader = iface.getClassLoader(); |
|
|
|
|
URL url = classloader.getResource(pkgName.replace('.', '/')); |
|
|
|
|
Enumeration<URL> urlEnumeration = null; |
|
|
|
|
try { |
|
|
|
|
urlEnumeration = classloader.getResources(pkgName.replace('.', '/')); |
|
|
|
|
} catch (IOException e) { |
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage()); |
|
|
|
|
} |
|
|
|
|
while (urlEnumeration.hasMoreElements()) { |
|
|
|
|
URL url = urlEnumeration.nextElement(); |
|
|
|
|
String classFilePath = url.getFile(); |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
@ -245,6 +253,7 @@ public abstract class FunctionConstants {
|
|
|
|
|
for (String fileName : findClassNamesUnderFilePath(classFilePath)) { |
|
|
|
|
try { |
|
|
|
|
Class<?> cls = Class.forName(pkgName + "." + fileName.substring(0, fileName.length() - 6)); |
|
|
|
|
System.out.println(pkgName + "." + fileName.substring(0, fileName.length() - 6)); |
|
|
|
|
if (StableUtils.classInstanceOf(cls, iface)) { |
|
|
|
|
Function inst; |
|
|
|
|
inst = (Function)cls.newInstance(); |
|
|
|
@ -262,3 +271,4 @@ public abstract class FunctionConstants {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|