File tree Expand file tree Collapse file tree 2 files changed +46
-2
lines changed
IOT-Guide-RuleEngine-ThingsBoard/src/main/java/iot/technology/thingsboard/ruleengine/service Expand file tree Collapse file tree 2 files changed +46
-2
lines changed Original file line number Diff line number Diff line change 33import iot .technology .actor .ActorSystem ;
44import iot .technology .actor .core .ActorRef ;
55import lombok .extern .slf4j .Slf4j ;
6- import org .springframework .stereotype .Service ;
6+ import org .springframework .stereotype .Component ;
77
88/**
99 * @author mushuwei
1010 */
11- @ Service
1211@ Slf4j
12+ @ Component
1313public class ActorSystemContext {
1414
1515 private ActorSystem system ;
Original file line number Diff line number Diff line change 1+ package iot .technology .thingsboard .ruleengine .service ;
2+
3+ import iot .technology .actor .core .AbstractActor ;
4+ import iot .technology .actor .core .InitFailureStrategy ;
5+ import iot .technology .actor .core .ProcessFailureStrategy ;
6+ import iot .technology .actor .exception .ActorException ;
7+ import iot .technology .actor .message .ActorMsg ;
8+ import lombok .extern .slf4j .Slf4j ;
9+
10+ /**
11+ * @author mushuwei
12+ */
13+ @ Slf4j
14+ public abstract class ContextAwareActor extends AbstractActor {
15+
16+ public static final int ENTITY_PACK_LIMIT = 1024 ;
17+
18+ protected final ActorSystemContext systemContext ;
19+
20+ public ContextAwareActor (ActorSystemContext systemContext ) {
21+ super ();
22+ this .systemContext = systemContext ;
23+ }
24+
25+ @ Override
26+ public boolean process (ActorMsg msg ) {
27+ return false ;
28+ }
29+
30+ @ Override
31+ public void destroy () throws ActorException {
32+ super .destroy ();
33+ }
34+
35+ @ Override
36+ public InitFailureStrategy onInitFailure (int attempt , Throwable t ) {
37+ return super .onInitFailure (attempt , t );
38+ }
39+
40+ @ Override
41+ public ProcessFailureStrategy onProcessFailure (Throwable t ) {
42+ return super .onProcessFailure (t );
43+ }
44+ }
You can’t perform that action at this time.
0 commit comments