Remove persisting double invocation

- As it's currently expected that pre/post interceptor are called
  for both preStateChange and postStateChange, fix
  AbstractPersistingStateMachineInterceptor so that actual persist
  doesn't happen twice.
- Eventually original preStateChange and postStateChange methods
  will get removed after deprecation(which should have happened
  a long time ago).
- Fixes #871
This commit is contained in:
Janne Valkealahti
2020-10-17 10:29:13 +01:00
parent 7c1f81252e
commit 06df05cd27

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017-2019 the original author or authors.
* Copyright 2017-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -81,12 +81,6 @@ public abstract class AbstractPersistingStateMachineInterceptor<S, E, T> extends
}
}
@Override
public void preStateChange(State<S, E> state, Message<E> message, Transition<S, E> transition,
StateMachine<S, E> stateMachine) {
preStateChange(state, message, transition, stateMachine, stateMachine);
}
@SuppressWarnings("unchecked")
@Override
public void postStateChange(State<S, E> state, Message<E> message, Transition<S, E> transition,
@@ -108,12 +102,6 @@ public abstract class AbstractPersistingStateMachineInterceptor<S, E, T> extends
}
}
@Override
public void postStateChange(State<S, E> state, Message<E> message, Transition<S, E> transition,
StateMachine<S, E> stateMachine) {
postStateChange(state, message, transition, stateMachine, stateMachine);
}
/**
* Write {@link StateMachineContext} into persistent store.
*