public abstract class SwitchTask extends AbstractTask
| Constructor and Description |
|---|
SwitchTask(java.lang.String id,
TransitionMatcher[] onMatchers,
TransitionMatcher[] offMatchers)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
matches(Transition transition)
Checks if given
transition matches to any of
matchers. |
void |
perform(TransitionContext context)
Performs desired actions for given
transition. |
protected abstract void |
performOff(TransitionContext context)
Performs for switched off.
|
protected abstract void |
performOn(TransitionContext context)
Performs for switched on.
|
void |
prepare(TransitionContext context)
Prepares for given
context. |
protected abstract void |
prepareOff(TransitionContext context)
Prepares to be off.
|
protected abstract void |
prepareOn(TransitionContext context)
Prepares to be on.
|
getIdpublic SwitchTask(java.lang.String id,
TransitionMatcher[] onMatchers,
TransitionMatcher[] offMatchers)
id - task idonMatchers - matchers for switching on; none null; none emptyoffMatchers - matchers for switching off; none null; none emptypublic boolean matches(Transition transition)
Tasktransition matches to any of
matchers.matches in interface Taskmatches in class AbstractTasktransition - transition to match.public void prepare(TransitionContext context) throws FSMException
Taskcontext.context - transition contextFSMException - if an error occurs.protected abstract void prepareOn(TransitionContext context) throws FSMException
context - transition contextFSMException - if an error occurs.protected abstract void prepareOff(TransitionContext context) throws FSMException
context - transition contextFSMException - if an error occurs.public void perform(TransitionContext context) throws FSMException
Tasktransition.context - transition contextFSMException - if an error occurs.protected abstract void performOn(TransitionContext context) throws FSMException
context - transition contextFSMException - if an error occurs.protected abstract void performOff(TransitionContext context) throws FSMException
context - transition contextFSMException - if an error occurs.Copyright © 2011. All Rights Reserved.