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.- Author:
- Janne Valkealahti
-
Constructor Summary
ConstructorDescriptionInstantiates 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 TypeMethodDescriptionvoid
registerAction
(String id, Action<S, E> action) RegisterAction
with a given id.void
registerGuard
(String id, Guard<S, E> guard) RegisterGuard
with a given id.resolveAction
(String id) Resolve action.resolveGuard
(String id) Resolve guard.void
setBeanFactory
(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:StateMachineComponentResolver
Resolve action.- Specified by:
resolveAction
in interfaceStateMachineComponentResolver<S,
E> - Parameters:
id
- the id- Returns:
- the action
-
resolveGuard
Description copied from interface:StateMachineComponentResolver
Resolve guard.- Specified by:
resolveGuard
in interfaceStateMachineComponentResolver<S,
E> - Parameters:
id
- the id- Returns:
- the guard
-
registerAction
RegisterAction
with a given id.- Parameters:
id
- the idaction
- the action
-
registerGuard
RegisterGuard
with 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
-