Top   Module   Use   Manual   Index 
 EXPORTING SERVICES | METHODS' SUMMARY | METHODS' DETAILS 

com :: sun :: star :: task ::

interface XSimpleTask

Base Interface
com::sun::star::uno::XInterface

Description
An object which supports this interface is a task or a job. The main reason to use tasks instead of normal method calls to delegate the control flow to a task manager.
A simple task is only usefull if the task is independ to other task and occupy no resources.
The XTask implementation of the task manager try to aggregate the implementation of XSimpleTask in the createTask method. You should supply the XAggregation interface.
See also
XTaskManager
See also
XResource
See also
XTask
See also
concepts#Resourcen
See also
concepts#Prealloc
Resource Konzept
See also
concepts#Ondemand
Resource Konzept


Methods' Summary

getName
start Do all things in this call to setup the task.
Normally all resources needed by this task are locked.
end After the task is completly done, call end to free all resources occupied by the task.
Normally all resources locked by this task are unlocked.
terminate A call of this method indicates that the task should terminate.
This call results in a listener finished call with reason CANCEL. If the task is not started, than only finished and no running is called.
run Do the action specified by the task. Call the listener method running at the beginng and the method finished with reason OK at the end. If an error occured the reason is ERROR and if the action is terminated than CANCEL is the reason.
addTaskListener Add a task listener. If the task is already running, than the running method is called.
removeTaskListener Remove a task listener.

Methods' Details

getName
 
string
getName();
start
 
void
start();
Description
Do all things in this call to setup the task.
Normally all resources needed by this task are locked.
end
 
void
end();
Description
After the task is completly done, call end to free all resources occupied by the task.
Normally all resources locked by this task are unlocked.
terminate
 
void
terminate();
Description
A call of this method indicates that the task should terminate.
This call results in a listener finished call with reason CANCEL. If the task is not started, than only finished and no running is called.
See also
com::sun::star::resource::TaskManager::terminateTaskAndDepTasks
See also
com::sun::star::resource::TaskManager::terminateDependendTasks
run
 
any
run( )
raises ( com::sun::star::task::ResourceLockException );

Description
Do the action specified by the task. Call the listener method running at the beginng and the method finished with reason OK at the end. If an error occured the reason is ERROR and if the action is terminated than CANCEL is the reason.
Returns
the same result which are defined in FinishTaskEvent.Result.
addTaskListener
 
void
addTaskListener(
[ in ] com::sun::star::task::XTaskListener Listener );

Description
Add a task listener. If the task is already running, than the running method is called.
removeTaskListener
 
void
removeTaskListener(
[ in ] com::sun::star::task::XTaskListener Listener );

Description
Remove a task listener.

Top of Page