@Override public StateMachineContext context() { return parent.context(); }
@Override public StateMachineContext context() { return parent.context(); }
@Override public StateMachineContext context() { return parent.context(); }
ResourceManagerStateMachineExecutor(long resource, StateMachineExecutor parent) { this.parent = parent; this.context = new ResourceManagerStateMachineContext(parent.context()); this.logger = LoggerFactory.getLogger(String.format("%s-%d", getClass().getName(), resource)); }
/** * Initializes the state machine. * * @param executor The state machine executor. * @throws NullPointerException if {@code context} is null */ public void init(StateMachineExecutor executor) { this.executor = Assert.notNull(executor, "executor"); this.context = executor.context(); this.clock = context.clock(); this.sessions = context.sessions(); if (this instanceof SessionListener) { executor.context().sessions().addListener((SessionListener) this); } configure(executor); }
/** * Initializes the state machine. * * @param executor The state machine executor. * @throws NullPointerException if {@code context} is null */ public void init(StateMachineExecutor executor) { this.executor = Assert.notNull(executor, "executor"); this.context = executor.context(); this.clock = context.clock(); this.sessions = context.sessions(); if (this instanceof SessionListener) { executor.context().sessions().addListener((SessionListener) this); } configure(executor); }
/** * Initializes the state machine. * * @param executor The state machine executor. * @throws NullPointerException if {@code context} is null */ public void init(StateMachineExecutor executor) { this.executor = Assert.notNull(executor, "executor"); this.context = executor.context(); this.clock = context.clock(); this.sessions = context.sessions(); if (this instanceof SessionListener) { executor.context().sessions().addListener((SessionListener) this); } configure(executor); }
@Override public final void init(StateMachineExecutor executor) { executor.serializer().register(ResourceCommand.class, -50); executor.serializer().register(ResourceQuery.class, -51); executor.serializer().register(ResourceQuery.Config.class, -52); executor.serializer().register(ResourceCommand.Delete.class, -53); executor.serializer().register(ResourceEvent.class, -49); executor.context().sessions().addListener(this); ResourceStateMachineExecutor wrappedExecutor = new ResourceStateMachineExecutor(executor); wrappedExecutor.register(ResourceQuery.Config.class, this::config); wrappedExecutor.<ResourceCommand.Register>register(ResourceCommand.Register.class, this::register); wrappedExecutor.<ResourceCommand.Unregister>register(ResourceCommand.Unregister.class, this::unregister); wrappedExecutor.<ResourceCommand.Delete>register(ResourceCommand.Delete.class, this::delete); super.init(wrappedExecutor); }