Class DefaultStateMachineComponentResolver<S,E>
java.lang.Object
org.springframework.statemachine.config.model.DefaultStateMachineComponentResolver<S,E>
- Type Parameters:
S- the type of stateE- the type of event
- All Implemented Interfaces:
StateMachineComponentResolver<S,E>
public class DefaultStateMachineComponentResolver<S,E>
extends Object
implements StateMachineComponentResolver<S,E>
Default implementation of a
StateMachineComponentResolver which resolves
from a BeanFactory if given or from a manually registered actions and guards.-
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new default state machine component resolver.DefaultStateMachineComponentResolver(Map<String, Action<S, E>> registeredActions, Map<String, Guard<S, E>> registeredGuards) Instantiates a new default state machine component resolver.DefaultStateMachineComponentResolver(org.springframework.beans.factory.BeanFactory beanFactory, Map<String, Action<S, E>> registeredActions, Map<String, Guard<S, E>> registeredGuards) Instantiates a new default state machine component resolver. -
Method Summary
Modifier and TypeMethodDescriptionvoidregisterAction(String id, Action<S, E> action) RegisterActionwith a given id.voidregisterGuard(String id, Guard<S, E> guard) RegisterGuardwith a given id.resolveAction(String id) Resolve action.resolveGuard(String id) Resolve guard.voidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) Sets the bean factory.
-
Constructor Details
-
DefaultStateMachineComponentResolver
public DefaultStateMachineComponentResolver()Instantiates a new default state machine component resolver. -
DefaultStateMachineComponentResolver
public DefaultStateMachineComponentResolver(Map<String, Action<S, E>> registeredActions, Map<String, Guard<S, E>> registeredGuards) Instantiates a new default state machine component resolver.- Parameters:
registeredActions- the registered actionsregisteredGuards- the registered guards
-
DefaultStateMachineComponentResolver
public DefaultStateMachineComponentResolver(org.springframework.beans.factory.BeanFactory beanFactory, Map<String, Action<S, E>> registeredActions, Map<String, Guard<S, E>> registeredGuards) Instantiates a new default state machine component resolver.- Parameters:
beanFactory- the bean factoryregisteredActions- the registered actionsregisteredGuards- the registered guards
-
-
Method Details
-
resolveAction
Description copied from interface:StateMachineComponentResolverResolve action.- Specified by:
resolveActionin interfaceStateMachineComponentResolver<S,E> - Parameters:
id- the id- Returns:
- the action
-
resolveGuard
Description copied from interface:StateMachineComponentResolverResolve guard.- Specified by:
resolveGuardin interfaceStateMachineComponentResolver<S,E> - Parameters:
id- the id- Returns:
- the guard
-
registerAction
RegisterActionwith a given id.- Parameters:
id- the idaction- the action
-
registerGuard
RegisterGuardwith a given id.- Parameters:
id- the idguard- the guard
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) Sets the bean factory.- Parameters:
beanFactory- the new bean factory
-