S
- the type of stateE
- the type of eventpublic class DefaultStateMachineComponentResolver<S,E> extends java.lang.Object implements StateMachineComponentResolver<S,E>
StateMachineComponentResolver
which resolves
from a BeanFactory
if given or from a manually registered actions and guards.Constructor and Description |
---|
DefaultStateMachineComponentResolver()
Instantiates a new default state machine component resolver.
|
DefaultStateMachineComponentResolver(org.springframework.beans.factory.BeanFactory beanFactory,
java.util.Map<java.lang.String,Action<S,E>> registeredActions,
java.util.Map<java.lang.String,Guard<S,E>> registeredGuards)
Instantiates a new default state machine component resolver.
|
DefaultStateMachineComponentResolver(java.util.Map<java.lang.String,Action<S,E>> registeredActions,
java.util.Map<java.lang.String,Guard<S,E>> registeredGuards)
Instantiates a new default state machine component resolver.
|
Modifier and Type | Method and Description |
---|---|
void |
registerAction(java.lang.String id,
Action<S,E> action)
Register
Action with a given id. |
void |
registerGuard(java.lang.String id,
Guard<S,E> guard)
Register
Guard with a given id. |
Action<S,E> |
resolveAction(java.lang.String id)
Resolve action.
|
Guard<S,E> |
resolveGuard(java.lang.String id)
Resolve guard.
|
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
Sets the bean factory.
|
public DefaultStateMachineComponentResolver()
public DefaultStateMachineComponentResolver(java.util.Map<java.lang.String,Action<S,E>> registeredActions, java.util.Map<java.lang.String,Guard<S,E>> registeredGuards)
registeredActions
- the registered actionsregisteredGuards
- the registered guardspublic DefaultStateMachineComponentResolver(org.springframework.beans.factory.BeanFactory beanFactory, java.util.Map<java.lang.String,Action<S,E>> registeredActions, java.util.Map<java.lang.String,Guard<S,E>> registeredGuards)
beanFactory
- the bean factoryregisteredActions
- the registered actionsregisteredGuards
- the registered guardspublic Action<S,E> resolveAction(java.lang.String id)
StateMachineComponentResolver
resolveAction
in interface StateMachineComponentResolver<S,E>
id
- the idpublic Guard<S,E> resolveGuard(java.lang.String id)
StateMachineComponentResolver
resolveGuard
in interface StateMachineComponentResolver<S,E>
id
- the idpublic void registerAction(java.lang.String id, Action<S,E> action)
Action
with a given id.id
- the idaction
- the actionpublic void registerGuard(java.lang.String id, Guard<S,E> guard)
Guard
with a given id.id
- the idguard
- the guardpublic void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
beanFactory
- the new bean factory