Class DefaultStateConfigurer<S,E>
java.lang.Object
org.springframework.statemachine.config.common.annotation.AnnotationConfigurerAdapter<StatesData<S,E>,StateMachineStateConfigurer<S,E>,StateMachineStateBuilder<S,E>>
org.springframework.statemachine.config.configurers.DefaultStateConfigurer<S,E>
- Type Parameters:
S
- the type of stateE
- the type of event
- All Implemented Interfaces:
AnnotationConfigurer<StatesData<S,
,E>, StateMachineStateBuilder<S, E>> AnnotationConfigurerBuilder<StateMachineStateConfigurer<S,
,E>> StateConfigurer<S,
E>
public class DefaultStateConfigurer<S,E>
extends AnnotationConfigurerAdapter<StatesData<S,E>,StateMachineStateConfigurer<S,E>,StateMachineStateBuilder<S,E>>
implements StateConfigurer<S,E>
Default implementation of a
StateConfigurer
.- Author:
- Janne Valkealahti
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.statemachine.config.configurers.StateConfigurer
StateConfigurer.History
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSpecify a stateS
to be choice pseudo state.void
configure
(StateMachineStateBuilder<S, E> builder) Configure theAnnotationBuilder
by setting the necessary properties on theAnnotationBuilder
.Specify a stateS
to be end state.Specify a stateS
to be entrypoint pseudo state.Specify a stateS
to be exitpoint pseudo state.Specify a stateS
to be fork pseudo state.history
(S history, StateConfigurer.History type) Specify a stateS
to be history pseudo state.Specify a initial stateS
.Specify a initial stateS
with anAction
to be executed with it.Specify a stateS
to be join pseudo state.Specify a stateS
to be junction pseudo state.Specify a states configured by this configurer instance to be substates of stateS
.Specify a region for these states configured by this configurer instance.Specify a stateS
.Specify a stateS
with a deferred eventsE
.Specify a stateS
with stateAction
s.state
(S state, Collection<? extends Action<S, E>> entryActions, Collection<? extends Action<S, E>> exitActions) Specify a stateS
with entry and exitAction
s.Specify a stateS
with stateAction
.Specify a stateS
with entry and exitAction
.state
(S state, StateMachineFactory<S, E> stateMachineFactory) Specify a stateS
and its relation with a given machine as substate machine factory.state
(S state, StateMachine<S, E> stateMachine) Specify a stateS
and its relation with a given machine as substate machine.Specify a stateS
with state behaviourAction
.stateDoFunction
(S state, Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>> stateAction) Specify a stateS
with state behaviourFunction
.stateEntry
(S state, Action<S, E> action) Specify a stateS
with state entryAction
.stateEntryFunction
(S state, Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>> action) Specify a stateS
with state entryFunction
.Specify a stateS
with state exitAction
.stateExitFunction
(S state, Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>> action) Specify a stateS
with state exitFunction
.Specify a statesS
.Methods inherited from class org.springframework.statemachine.config.common.annotation.AnnotationConfigurerAdapter
addObjectPostProcessor, and, getBuilder, init, isAssignable, setBuilder
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.statemachine.config.common.annotation.AnnotationConfigurerBuilder
and
-
Constructor Details
-
DefaultStateConfigurer
public DefaultStateConfigurer()
-
-
Method Details
-
configure
Description copied from interface:AnnotationConfigurer
Configure theAnnotationBuilder
by setting the necessary properties on theAnnotationBuilder
.- Specified by:
configure
in interfaceAnnotationConfigurer<S,
E> - Overrides:
configure
in classAnnotationConfigurerAdapter<StatesData<S,
E>, StateMachineStateConfigurer<S, E>, StateMachineStateBuilder<S, E>> - Parameters:
builder
- the builder- Throws:
Exception
- if error occurred
-
initial
Description copied from interface:StateConfigurer
Specify a initial stateS
.- Specified by:
initial
in interfaceStateConfigurer<S,
E> - Parameters:
initial
- the initial state- Returns:
- configurer for chaining
-
initial
Description copied from interface:StateConfigurer
Specify a initial stateS
with anAction
to be executed with it. Action can be i.e. used to init extended variables.- Specified by:
initial
in interfaceStateConfigurer<S,
E> - Parameters:
initial
- the initial stateaction
- the action- Returns:
- configurer for chaining
-
parent
Description copied from interface:StateConfigurer
Specify a states configured by this configurer instance to be substates of stateS
.- Specified by:
parent
in interfaceStateConfigurer<S,
E> - Parameters:
state
- the parent state- Returns:
- configurer for chaining
-
region
Description copied from interface:StateConfigurer
Specify a region for these states configured by this configurer instance.- Specified by:
region
in interfaceStateConfigurer<S,
E> - Parameters:
id
- the region id- Returns:
- configurer for chaining
-
end
Description copied from interface:StateConfigurer
Specify a stateS
to be end state. This method can be called for each state to be marked as end state.- Specified by:
end
in interfaceStateConfigurer<S,
E> - Parameters:
end
- the end state- Returns:
- configurer for chaining
-
state
Description copied from interface:StateConfigurer
Specify a stateS
.- Specified by:
state
in interfaceStateConfigurer<S,
E> - Parameters:
state
- the state- Returns:
- configurer for chaining
-
state
Description copied from interface:StateConfigurer
Specify a stateS
and its relation with a given machine as substate machine.- Specified by:
state
in interfaceStateConfigurer<S,
E> - Parameters:
state
- the statestateMachine
- the submachine- Returns:
- configurer for chaining
-
state
Description copied from interface:StateConfigurer
Specify a stateS
and its relation with a given machine as substate machine factory.- Specified by:
state
in interfaceStateConfigurer<S,
E> - Parameters:
state
- the statestateMachineFactory
- the submachine factory- Returns:
- configurer for chaining
-
state
Description copied from interface:StateConfigurer
Specify a stateS
with stateAction
s.- Specified by:
state
in interfaceStateConfigurer<S,
E> - Parameters:
state
- the statestateActions
- the state actions- Returns:
- configurer for chaining
-
state
Description copied from interface:StateConfigurer
Specify a stateS
with stateAction
.- Specified by:
state
in interfaceStateConfigurer<S,
E> - Parameters:
state
- the statestateAction
- the state action- Returns:
- configurer for chaining
-
stateDo
Description copied from interface:StateConfigurer
Specify a stateS
with state behaviourAction
. Currently synonym forStateConfigurer.state(Object, Action)
.- Specified by:
stateDo
in interfaceStateConfigurer<S,
E> - Parameters:
state
- the stateaction
- the state action- Returns:
- configurer for chaining
- See Also:
-
stateDoFunction
public StateConfigurer<S,E> stateDoFunction(S state, Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>> stateAction) Description copied from interface:StateConfigurer
Specify a stateS
with state behaviourFunction
.- Specified by:
stateDoFunction
in interfaceStateConfigurer<S,
E> - Parameters:
state
- the statestateAction
- the state action- Returns:
- configurer for chaining
-
stateEntryFunction
public StateConfigurer<S,E> stateEntryFunction(S state, Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>> action) Description copied from interface:StateConfigurer
Specify a stateS
with state entryFunction
.- Specified by:
stateEntryFunction
in interfaceStateConfigurer<S,
E> - Parameters:
state
- the stateaction
- the state action- Returns:
- configurer for chaining
-
stateExitFunction
public StateConfigurer<S,E> stateExitFunction(S state, Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>> action) Description copied from interface:StateConfigurer
Specify a stateS
with state exitFunction
.- Specified by:
stateExitFunction
in interfaceStateConfigurer<S,
E> - Parameters:
state
- the stateaction
- the state action- Returns:
- configurer for chaining
-
stateDo
Description copied from interface:StateConfigurer
- Specified by:
stateDo
in interfaceStateConfigurer<S,
E> - Parameters:
state
- the stateaction
- the state actionerror
- action that will be called if any unexpected exception is thrown by the action.- Returns:
- configurer for chaining
-
state
public StateConfigurer<S,E> state(S state, Collection<? extends Action<S, E>> entryActions, Collection<? extends Action<S, E>> exitActions) Description copied from interface:StateConfigurer
Specify a stateS
with entry and exitAction
s.- Specified by:
state
in interfaceStateConfigurer<S,
E> - Parameters:
state
- the stateentryActions
- the state entry actionsexitActions
- the state exit actions- Returns:
- configurer for chaining
-
state
Description copied from interface:StateConfigurer
Specify a stateS
with entry and exitAction
.- Specified by:
state
in interfaceStateConfigurer<S,
E> - Parameters:
state
- the stateentryAction
- the state entry actionexitAction
- the state exit action- Returns:
- configurer for chaining
-
stateEntry
Description copied from interface:StateConfigurer
Specify a stateS
with state entryAction
. Currently synonym forStateConfigurer.state(Object, Action, Action)
with no exit action.- Specified by:
stateEntry
in interfaceStateConfigurer<S,
E> - Parameters:
state
- the stateaction
- the state entry action- Returns:
- configurer for chaining
- See Also:
-
stateEntry
Description copied from interface:StateConfigurer
Specify a stateS
with state entryAction
and errorAction
callback. Currently synonym forStateConfigurer.state(Object, Action, Action)
with no exit action.- Specified by:
stateEntry
in interfaceStateConfigurer<S,
E> - Parameters:
state
- the stateaction
- the state entry actionerror
- action that will be called if any unexpected exception is thrown by the action.- Returns:
- configurer for chaining
- See Also:
-
stateExit
Description copied from interface:StateConfigurer
Specify a stateS
with state exitAction
. Currently synonym forStateConfigurer.state(Object, Action, Action)
with no entry action.- Specified by:
stateExit
in interfaceStateConfigurer<S,
E> - Parameters:
state
- the stateaction
- the state exit action- Returns:
- configurer for chaining
- See Also:
-
stateExit
Description copied from interface:StateConfigurer
Specify a stateS
with state exitAction
and errorAction
callback. Currently synonym forStateConfigurer.state(Object, Action, Action)
with no entry action.- Specified by:
stateExit
in interfaceStateConfigurer<S,
E> - Parameters:
state
- the stateaction
- the state entry actionerror
- action that will be called if any unexpected exception is thrown by the action.- Returns:
- configurer for chaining
- See Also:
-
state
Description copied from interface:StateConfigurer
Specify a stateS
with a deferred eventsE
.- Specified by:
state
in interfaceStateConfigurer<S,
E> - Parameters:
state
- the statedeferred
- the deferred events- Returns:
- configurer for chaining
-
states
Description copied from interface:StateConfigurer
Specify a statesS
.- Specified by:
states
in interfaceStateConfigurer<S,
E> - Parameters:
states
- the states- Returns:
- configurer for chaining
-
choice
Description copied from interface:StateConfigurer
Specify a stateS
to be choice pseudo state.- Specified by:
choice
in interfaceStateConfigurer<S,
E> - Parameters:
choice
- the choice pseudo state- Returns:
- configurer for chaining
-
junction
Description copied from interface:StateConfigurer
Specify a stateS
to be junction pseudo state.- Specified by:
junction
in interfaceStateConfigurer<S,
E> - Parameters:
junction
- the junction pseudo state- Returns:
- configurer for chaining
-
fork
Description copied from interface:StateConfigurer
Specify a stateS
to be fork pseudo state.- Specified by:
fork
in interfaceStateConfigurer<S,
E> - Parameters:
fork
- the fork pseudo state- Returns:
- configurer for chaining
-
join
Description copied from interface:StateConfigurer
Specify a stateS
to be join pseudo state.- Specified by:
join
in interfaceStateConfigurer<S,
E> - Parameters:
join
- the join pseudo state- Returns:
- configurer for chaining
-
history
Description copied from interface:StateConfigurer
Specify a stateS
to be history pseudo state.- Specified by:
history
in interfaceStateConfigurer<S,
E> - Parameters:
history
- the history pseudo statetype
- the history pseudo state type- Returns:
- configurer for chaining
-
entry
Description copied from interface:StateConfigurer
Specify a stateS
to be entrypoint pseudo state.- Specified by:
entry
in interfaceStateConfigurer<S,
E> - Parameters:
entry
- the entrypoint pseudo state- Returns:
- configurer for chaining
-
exit
Description copied from interface:StateConfigurer
Specify a stateS
to be exitpoint pseudo state.- Specified by:
exit
in interfaceStateConfigurer<S,
E> - Parameters:
exit
- the exitpoint pseudo state- Returns:
- configurer for chaining
-