Browse Source

冲突修改

pull/1/head
richie 5 years ago
parent
commit
ded286c7eb
  1. 32
      src/main/java/com/fr/learn/Leaner.java

32
src/main/java/com/fr/learn/Leaner.java

@ -1,8 +1,11 @@
package com.fr.learn; package com.fr.learn;
import com.fr.start.Designer; import com.fr.log.FineLoggerFactory;
public class Leaner extends Designer { import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class Leaner {
static { static {
// 这段代码让插件能支持远程设计的时候的调试 // 这段代码让插件能支持远程设计的时候的调试
@ -10,7 +13,28 @@ public class Leaner extends Designer {
System.setProperty("fine.plugin.home", workDir + "/webroot/WEB-INF/plugins"); System.setProperty("fine.plugin.home", workDir + "/webroot/WEB-INF/plugins");
} }
public Leaner(String[] strings) { public static void main(String[] args) {
super(strings); try {
Class mainClass = Class.forName("com.fr.start.MainDesigner");
invokeMain(mainClass, args);
} catch (ClassNotFoundException e) {
// MainDesigner找不到,走以前的Designer
try {
Class oldMainClass = Class.forName("com.fr.start.Designer");
invokeMain(oldMainClass, args);
} catch (ClassNotFoundException ex) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}
private static void invokeMain(Class clazz, String[] args) {
try {
Method method = clazz.getMethod("main", String[].class);
Object[] param = new Object[] {args};
method.invoke(clazz, param);
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
} }
} }

Loading…
Cancel
Save