-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
995517265@qq.com
committed
Mar 23, 2022
1 parent
8d8036c
commit 51d0624
Showing
8 changed files
with
105 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
ice-core/src/main/java/com/ice/core/utils/IceErrorHandle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.ice.core.utils; | ||
|
||
import com.ice.common.enums.NodeRunStateEnum; | ||
import com.ice.core.base.BaseNode; | ||
import com.ice.core.context.IceContext; | ||
import lombok.Data; | ||
|
||
/** | ||
* @author zjn | ||
* IceErrorHandle | ||
* used on error occur in node | ||
*/ | ||
@Data | ||
public abstract class IceErrorHandle { | ||
|
||
private static IceErrorHandle handle = new DefaultIceErrorHandle(); | ||
|
||
public static void setHandle(IceErrorHandle customHandle) { | ||
handle = customHandle; | ||
} | ||
|
||
public static NodeRunStateEnum handleError(BaseNode node, IceContext cxt) { | ||
return handle.handle(node, cxt); | ||
} | ||
|
||
protected abstract NodeRunStateEnum handle(BaseNode node, IceContext cxt); | ||
|
||
private static class DefaultIceErrorHandle extends IceErrorHandle { | ||
|
||
@Override | ||
protected NodeRunStateEnum handle(BaseNode node, IceContext cxt) { | ||
//default do noting and shutdown | ||
return NodeRunStateEnum.SHUT_DOWN; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters