@Override protected void createDefaultState() { super.createDefaultState(); }
/** * Registers a single shot timer for the current actor. The timer is automatically disposed on deactivation. * The timer calls will keep the actor active. Timer calls are serialized according to the actor policy. * Each stateless actor activation has it's on set of timers. * * @param futureCallable a callable that returns a Task * @param dueTime Time to the first timer call * @param period Interval between calls, if period <= 0 then the timer will be single shot. * @param timeUnit Time unit for dueTime and period * @return A registration object that allows the actor to cancel the timer. */ protected Registration registerTimer(Callable<Task<?>> futureCallable, long dueTime, TimeUnit timeUnit) { return registerTimer(futureCallable, dueTime, 0L, timeUnit); }
public Object interceptStateMethod( final Method method, final String event, final Object[] args) { return ((ActorState) state()).invokeEvent(event, args); }
/** * Creates a default state representation for this actor */ @SuppressWarnings({ "PMD.LooseCoupling", "unchecked" }) protected void createDefaultState() { Class<?> c = getStateClass(); try { Object newState = (T) c.newInstance(); this.state = (T) newState; } catch (Exception e) { throw new UncheckedException(e); } }
ActorRuntime.getRuntime().clock().millis(), transactionId, event, args)); return (CompletableFuture) super.interceptStateMethod(method, event, args); }); transactionId, event, args)); return super.interceptStateMethod(method, event, args);
protected AbstractActor() { this.createDefaultState(); }