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
TimelineRunnable
which is an extension of Runnable- Swing-specific
TimelineSwingWorker
class 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 actorpublic 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:
TimelineScenario.Parallel
runs all the actors in a parallel fashionTimelineScenario.Sequence
runs the actors one after another in the order they have been addedTimelineScenario.RendezvousSequence
allows 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.