|
|
@ -11,11 +11,11 @@ import com.fr.exit.DesignerExiter; |
|
|
|
import com.fr.general.IOUtils; |
|
|
|
import com.fr.general.IOUtils; |
|
|
|
import com.fr.io.utils.ResourceIOUtils; |
|
|
|
import com.fr.io.utils.ResourceIOUtils; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.process.ProcessEventPipe; |
|
|
|
|
|
|
|
import com.fr.process.engine.core.CarryMessageEvent; |
|
|
|
import com.fr.process.engine.core.CarryMessageEvent; |
|
|
|
import com.fr.process.engine.core.FineProcessContext; |
|
|
|
import com.fr.process.engine.core.FineProcessContext; |
|
|
|
import com.fr.stable.StableUtils; |
|
|
|
import com.fr.stable.StableUtils; |
|
|
|
import com.fr.stable.lifecycle.ErrorType; |
|
|
|
import com.fr.stable.lifecycle.ErrorType; |
|
|
|
|
|
|
|
import com.fr.stable.lifecycle.ErrorTypeHelper; |
|
|
|
import com.fr.stable.lifecycle.FineLifecycleFatalError; |
|
|
|
import com.fr.stable.lifecycle.FineLifecycleFatalError; |
|
|
|
import com.fr.stable.project.ProjectConstants; |
|
|
|
import com.fr.stable.project.ProjectConstants; |
|
|
|
|
|
|
|
|
|
|
@ -34,13 +34,7 @@ public class LifecycleFatalErrorHandler { |
|
|
|
private Map<ErrorType, Handler> map = new HashMap<>(); |
|
|
|
private Map<ErrorType, Handler> map = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
private LifecycleFatalErrorHandler() { |
|
|
|
private LifecycleFatalErrorHandler() { |
|
|
|
for (ErrorType type : ErrorType.values()) { |
|
|
|
map.put(ErrorTypeHelper.FINEDB, FineDBHandler.SELF); |
|
|
|
if (ErrorType.FINEDB.equals(type)) { |
|
|
|
|
|
|
|
map.put(type, FineDBHandler.SELF); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
map.put(type, DefaultHandler.SELF); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static LifecycleFatalErrorHandler getInstance() { |
|
|
|
public static LifecycleFatalErrorHandler getInstance() { |
|
|
@ -50,7 +44,12 @@ public class LifecycleFatalErrorHandler { |
|
|
|
public void handle(FineLifecycleFatalError fatal) { |
|
|
|
public void handle(FineLifecycleFatalError fatal) { |
|
|
|
SplashContext.getInstance().hide(); |
|
|
|
SplashContext.getInstance().hide(); |
|
|
|
FineProcessContext.getParentPipe().fire(new CarryMessageEvent(ReportState.STOP.getValue())); |
|
|
|
FineProcessContext.getParentPipe().fire(new CarryMessageEvent(ReportState.STOP.getValue())); |
|
|
|
map.get(fatal.getErrorType()).handle(fatal); |
|
|
|
|
|
|
|
|
|
|
|
Handler handler = map.get(fatal.getErrorType()); |
|
|
|
|
|
|
|
if (handler == null) { |
|
|
|
|
|
|
|
handler = DefaultHandler.SELF; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
handler.handle(fatal); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
interface Handler { |
|
|
|
interface Handler { |
|
|
|