This commit is contained in:
Janne Valkealahti
2020-12-11 10:30:33 +00:00
parent ee348d592f
commit 24ed6c3def
2 changed files with 2 additions and 6 deletions

View File

@@ -349,7 +349,7 @@ public abstract class AbstractStateMachineFactory<S, E> extends LifecycleObjectS
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(function -> function.addStateMachineInterceptor(adapter));
}
}
@@ -366,11 +366,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

@@ -96,7 +96,6 @@ public class StateMachineInterceptorList<S, E> {
* @param stateMachine the state machine
* @param rootStateMachine the root state machine
*/
@SuppressWarnings({ "deprecation" })
public void preStateChange(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) {
@@ -113,7 +112,6 @@ public class StateMachineInterceptorList<S, E> {
* @param stateMachine the state machine
* @param rootStateMachine the root state machine
*/
@SuppressWarnings({ "deprecation" })
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) {