This commit is contained in:
Janne Valkealahti
2020-12-11 10:28:19 +00:00
parent f3ec6ff072
commit ee6fc0c06f
2 changed files with 2 additions and 5 deletions

View File

@@ -368,7 +368,7 @@ public abstract class AbstractStateMachineFactory<S, E> extends LifecycleObjectS
if (interceptors != null) {
for (final StateMachineInterceptor<S, E> interceptor : interceptors) {
// add persisting interceptor hooks to all regions
RegionPersistingInterceptorAdapter<S, E> adapter = new RegionPersistingInterceptorAdapter<>(interceptor, machine);
RegionPersistingInterceptorAdapter<S, E> adapter = new RegionPersistingInterceptorAdapter<>(interceptor);
machine.getStateMachineAccessor().doWithAllRegions(new StateMachineFunction<StateMachineAccess<S,E>>() {
@Override
public void apply(StateMachineAccess<S, E> function) {
@@ -390,11 +390,9 @@ public abstract class AbstractStateMachineFactory<S, E> extends LifecycleObjectS
private static class RegionPersistingInterceptorAdapter<S, E> extends StateMachineInterceptorAdapter<S, E> {
private final StateMachineInterceptor<S, E> interceptor;
private final StateMachine<S, E> rootStateMachine;
public RegionPersistingInterceptorAdapter(StateMachineInterceptor<S, E> interceptor, StateMachine<S, E> rootStateMachine) {
public RegionPersistingInterceptorAdapter(StateMachineInterceptor<S, E> interceptor) {
this.interceptor = interceptor;
this.rootStateMachine = rootStateMachine;
}
@Override

View File

@@ -112,7 +112,6 @@ public class StateMachineInterceptorList<S, E> {
* @param stateMachine the state machine
* @param rootStateMachine the root state machine
*/
public void postStateChange(State<S, E> state, Message<E> message, Transition<S, E> transition,
StateMachine<S, E> stateMachine, StateMachine<S, E> rootStateMachine) {
for (StateMachineInterceptor<S, E> interceptor : interceptors) {