forked from IoT-Technology/IoT-Technical-Guide
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
9601c38
commit cf34cb8
Showing
2 changed files
with
46 additions
and
2 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
44 changes: 44 additions & 0 deletions
44
...sBoard/src/main/java/iot/technology/thingsboard/ruleengine/service/ContextAwareActor.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,44 @@ | ||
package iot.technology.thingsboard.ruleengine.service; | ||
|
||
import iot.technology.actor.core.AbstractActor; | ||
import iot.technology.actor.core.InitFailureStrategy; | ||
import iot.technology.actor.core.ProcessFailureStrategy; | ||
import iot.technology.actor.exception.ActorException; | ||
import iot.technology.actor.message.ActorMsg; | ||
import lombok.extern.slf4j.Slf4j; | ||
|
||
/** | ||
* @author mushuwei | ||
*/ | ||
@Slf4j | ||
public abstract class ContextAwareActor extends AbstractActor { | ||
|
||
public static final int ENTITY_PACK_LIMIT = 1024; | ||
|
||
protected final ActorSystemContext systemContext; | ||
|
||
public ContextAwareActor(ActorSystemContext systemContext) { | ||
super(); | ||
this.systemContext = systemContext; | ||
} | ||
|
||
@Override | ||
public boolean process(ActorMsg msg) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void destroy() throws ActorException { | ||
super.destroy(); | ||
} | ||
|
||
@Override | ||
public InitFailureStrategy onInitFailure(int attempt, Throwable t) { | ||
return super.onInitFailure(attempt, t); | ||
} | ||
|
||
@Override | ||
public ProcessFailureStrategy onProcessFailure(Throwable t) { | ||
return super.onProcessFailure(t); | ||
} | ||
} |