/** * Configures the state machine. * <p> * By default, this method will configure state machine operations by extracting public methods with * a single {@link Commit} parameter via reflection. Override this method to explicitly register * state machine operations via the provided {@link ServiceExecutor}. * * @param executor The state machine executor. */ protected void configure(ServiceExecutor executor) { Operations.getOperationMap(getClass()).forEach(((operationId, method) -> configure(operationId, method, executor))); }
@Override public final void init(ServiceContext context) { this.context = context; this.executor = new DefaultServiceExecutor(context, serializer()); this.log = ContextualLoggerFactory.getLogger(getClass(), LoggerContext.builder(PrimitiveService.class) .addValue(context.serviceId()) .add("type", context.serviceType()) .add("name", context.serviceName()) .build()); configure(executor); }