There are methods provided that are called before execution of an itinerary begins, and when the itinerary has completed. These methods take no parameters and return no values. Here are the method definitions:
public void beginExecution(); public void endExecution();
The beginExecution() method is called on each module before execution
begins. This method can set up any fields of the module or do any initialization
required. The endExecution() method is called when the execution completes.
It is very important that this method clear any fields that reference data that
is no longer needed. Any data references not cleared in this method will remain
in memory as long as the itinerary containing the module is loaded. For large
data sizes, this could be an unnecessary strain on heap resources.
Also, any state created by the module developers code will persist between executions of an itinerary unless it is explicitly reinitialized in these methods. For example, assume a module uses an instance variable of type integer to count the number of data inputs that have been processed during the first run of its itineray. If this variable is not explicitly reset in the beginExecution or endExecution methods, it will retain its previous value at the start of the next execution of the itinerary, which is probably not the intended behavior.
![]() |