Class RepositoryStateMachineModelFactory
java.lang.Object
org.springframework.statemachine.config.model.AbstractStateMachineModelFactory<String,String>
org.springframework.statemachine.data.RepositoryStateMachineModelFactory
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanFactoryAware
,org.springframework.context.ResourceLoaderAware
,StateMachineComponentResolver<String,
,String> StateMachineModelFactory<String,
String>
public class RepositoryStateMachineModelFactory
extends AbstractStateMachineModelFactory<String,String>
A generic
StateMachineModelFactory
which is backed by a Spring Data
Repository abstraction.-
Constructor Summary
ConstructorDescriptionRepositoryStateMachineModelFactory
(StateRepository<? extends RepositoryState> stateRepository, TransitionRepository<? extends RepositoryTransition> transitionRepository) Instantiates a new repository state machine model factory. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the state machine model.Builds the state machine model with a givenmachineId
.Methods inherited from class org.springframework.statemachine.config.model.AbstractStateMachineModelFactory
getBeanFactory, getResourceLoader, getStateMachineComponentResolver, registerAction, registerGuard, resolveAction, resolveGuard, setBeanFactory, setResourceLoader, setStateMachineComponentResolver
-
Constructor Details
-
RepositoryStateMachineModelFactory
public RepositoryStateMachineModelFactory(StateRepository<? extends RepositoryState> stateRepository, TransitionRepository<? extends RepositoryTransition> transitionRepository) Instantiates a new repository state machine model factory.- Parameters:
stateRepository
- the state repositorytransitionRepository
- the transition repository
-
-
Method Details
-
build
Description copied from interface:StateMachineModelFactory
Builds the state machine model.- Specified by:
build
in interfaceStateMachineModelFactory<String,
String> - Specified by:
build
in classAbstractStateMachineModelFactory<String,
String> - Returns:
- the state machine model
-
build
Description copied from interface:StateMachineModelFactory
Builds the state machine model with a givenmachineId
. Implementation is free to choose what to do with a givenmachineId
but usually it might map to a different configurations supported by storage or repository in a factory.- Specified by:
build
in interfaceStateMachineModelFactory<String,
String> - Overrides:
build
in classAbstractStateMachineModelFactory<String,
String> - Parameters:
machineId
- the machine id- Returns:
- the state machine model
-