itm/wsn-device-drivers — Issue #81: Timed out operation can harm next running operation
Author: mlegenhausen
Created: 2011-10-14 15:01:33+00:00
State: open

Problem:
When an operation timed out and is canceled, it can happen, that the finally block for leaving the programming mode is executed while the next operation is already running. This let this operation fail.

Solution:
Add lifecycle methods that are called before the operation is started and after the operation has finished or was canceled. Code executed in this methods can block the complete device, so only secure code should be executed there, like leaving programming mode.

Better solution:
Add annotation support to the ´Operation´ container. This will allow to hook in annotation inceptors that can run code before and after the run method of the ´OperationRunnable´ is called. This will also allow to enter the programming mode once instead for each sub operation. A very useful annotation would be ´@Program´.