com.kuka.task
Interface IRoboticsAPITask

All Known Implementing Classes:
RoboticsAPITask

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

initialize

void initialize()
                throws Exception
Will be called when the task is initialized.

Throws:
Exception - any exception. A task is not forced to catch exceptions if it doesn't want to handle it.

run

void run()
         throws Exception
Will be called to run the task after it has been initialized. Will be called from the same thread as 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.

Throws:
Exception - any exception. A task is not forced to catch exceptions if it doesn't want to handle it.
See Also:
Thread.isInterrupted(), InterruptedException

dispose

void dispose()
             throws Exception
Will be called when the task is about to be disposed, for example if the task is being asked to stop. This method gives the task an opportunity to clean up any resources that are being held (for example, memory, file handles, threads).

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.

Throws:
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.


Copyright © 2019. All rights reserved.