-
Notifications
You must be signed in to change notification settings - Fork 0
TimelineScenarioIntroduction
homebeaver edited this page Jul 19, 2022
·
2 revisions
Timeline scenario allows combining multiple timeline scenario actors in a parallel, sequential or custom order.
There are three core types of timeline scenario actors:
- Timelines
-
TimelineRunnablewhich is an extension of [Runnable|http://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html) -
Swing-specific
TimelineSwingWorkerclass which is an extension of SwingWorker.
Additional types of timeline scenario actors can be added in the application code by implementing the TimelineScenario.TimelineScenarioActor interface.
To create a custom timeline scenario, use the following APIs of the TimelineScenario class:
-
public void addScenarioActor(TimelineScenarioActor actor)adds the specified actor -
public void addDependency(TimelineScenarioActor actor, TimelineScenarioActor... waitFor)specifies the dependencies between the actors
There are three built-in timeline scenario kinds that address the most common dependencies between the actors:
-
Timeline.Parallelruns all the actors in a parallel fashion -
Timeline.Sequenceruns the actors one after another in the order they have been added -
Timeline.RendezvousSequenceallows simple branch-and-wait ordering. The rendezvous scenario has a stage-like approach. All actors belonging to the same stage run in parallel, while actors in stage N+1 wait for all actors in stage N to be finished. TheRendezvousSequence.rendezvous()marks the end of one stage and the beginning of another.