Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
The description of the start and stop stages on http://avalon.apache.org/products/runtime/reference/component/lifecycle/incarnation.html should be updated to include something like the following:
The Startable interface is used by any component that is constantly running for the duration of its life. The interface defines two methods: start and stop . Neither method has any parameters.
The contract surrounding this interface is that the start method is called once after the component is fully initialized, and the stop method is called once before the component is disposed of. Neither method will be called more than once, and start will always be called before stop . Furthermore, the method must return, it can not go into a endless loop. From this follows that the component should create a thread and call the Thread.start() method inside this method to ctart the continous processing. The stop() method should interrupt the thread in a safe manner. This should be done by variables and the Thread.interrupt() method, slightly depending on how the thread is operating. Implications of using this interface require that the start and stop methods be conducted safely (unlike the Thread.stop method) and not render the system unstable.