Lifecycle integration
Initialise and teardown nodes
Last updated
Initialise and teardown nodes
Last updated
The goal is to provide a facility for nodes in the SEP to receive initialise and teardown notifications.
Nodes may want to carry out one-off initialisation before processing events, or release resources if the SEP has completed processing and will receive no more events. Fluxtion provides two annotations that a node can a mark a method with to join the lifecycle callback set.
In this example we annotate several classes in a graph with various @Initialise and @TeardDown annotations. The generated SEP implements the lifecycle method callbacks in the init and teardown methods defined in the Lifecycle interface.
The code for the example is located here.
The two methods of interest in the SEP are the init and tearDown methods.
Note the generated SEP does not call the lifecycle methods init and tearDown that is the repsonsibility of the application code using the SEP.
The graphical representation of this execution graph as generated by Fluxtion ESC:
Annotation
Behaviour
Invoked before any events are processed. Initialisation methods are invoked in topological order.
Invoked after all events have been processed by the SEP. Teardown methods are invoked in reverse topological order.