Skip to content

Commit

Permalink
🚧 add rule engine thingsboard
Browse files Browse the repository at this point in the history
  • Loading branch information
sanshengshui committed Oct 26, 2021
1 parent 9601c38 commit cf34cb8
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import iot.technology.actor.ActorSystem;
import iot.technology.actor.core.ActorRef;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Component;

/**
* @author mushuwei
*/
@Service
@Slf4j
@Component
public class ActorSystemContext {

private ActorSystem system;
Expand Down
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);
}
}

0 comments on commit cf34cb8

Please sign in to comment.