|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IRoboticsAPITask
Basic task interface. All methods of this interface will be called from the task manager ITaskManager during
the task instance life cycle.
If the constructor of an implementation fails with an exception, the implementation must make sure that any resource that was allocated in the constructor is closed again.
After the instance of the implementation was successfully created, the dispose() method will be called in
any case when the task lifecycle ends. The implementation must make sure that the dispose() method closes
any resource that was allocated is closed properly.
| Method Summary | |
|---|---|
void |
dispose()
Will be called when the task is about to be disposed, for example if the task is being asked to stop. |
void |
initialize()
Will be called when the task is initialized. |
void |
run()
Will be called to run the task after it has been initialized. |
| Method Detail |
|---|
void initialize()
throws Exception
Exception - any exception. A task is not forced to catch exceptions if it doesn't want to handle it.
void run()
throws Exception
initialize().
The implementor must make sure that if the calling thread is interrupted, this method must come to an end without delay by returning or by throwing any exception.
Exception - any exception. A task is not forced to catch exceptions if it doesn't want to handle it.Thread.isInterrupted(),
InterruptedException
void dispose()
throws Exception
This method will be called from a separate thread, and may be called while the task is still initializing or running in a thread parallel to the dispose thread.
The implementation must close all resources that the application has opened, and it must signal all other application threads that might still run that they should stop immediately.
The thread calling this method might get interrupted, in which case the implementation should exit this method immediately.
The implementation of this method must be thread safe with respect to the other methods in this interface.
Exception - any exception. A task is not forced to catch exceptions if it doesn't want to handle it. Take care
however that you properly close any tasks and resources of your application, even if an exception is
thrown.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||