6.4. Plug-in life cycle

During a complete YaTiSeWoBe session, all plug-ins go through states that are explained in this section. Many aspects of this life cycle are based on the Java Applet life cycle [31].

Figure 6.1. Plug-in life cycle

Plugin life cycle

Complete life cycle for plug-ins during the span of a YaTiSeWoBe session.

6.4.1. "Create" state

For a plug-in to be available for YaTiSeWoBe, whichever type (see Section 3.3.1, “Types”) or level (see Section 3.3.2, “Levels”), it has to be created.

A plug-in is in the "create" state after it's constructor has return. If the constructor fails to return gracefully, the plug-in will not be available for the user.

Even a plug-in that has been in-activated by the user through the plug-in manager (Section 5.2.1, “Plug-in manager”), will go into this state. Therefor, no important resources should be acquired during construction.

The constructor is always called exactly once during a session.

6.4.2. "Init" state

A plug-in is in the "init" state after the call to it's void init(SharedProperties props) has returned gracefully.

The "init(SharedProperties)" function is called exactly once for active plug-ins during a session.

6.4.3. "Start" state

A plug-in is in the "start" state after the call to it's void start() has returned gracefully.

A plug-in can go from "start" to "stop" states many times during a session.

Figure 6.2. Window plug-in life cycle (partial)

Window plugin lifecycle

Window plug-ins have a specific "start" state.

6.4.4. "Stop" state

A plug-in is in the "stop" state after the call to it's void stop() has returned gracefully.

A plug-in can go from "start" to "stop" states many times during a session.

6.4.5. "Destroy" state

Before gracefully unloading the plug-ins, YaTiSeWoBe calls void destroy() on all active plug-ins to give them a chance to release cleanly their resources.

The "destroy()" function is called exactly once for active plug-ins during a session.