interface XSimpleTask in module com::sun::star::task::

(Global Index)

Syntax

interface XSimpleTask : 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

Method 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.

Method Details



getName

Syntax

string getName ();

start

Syntax

void start ();

Description

Do all things in this call to setup the task.
Normally all resources needed by this task are locked.


end

Syntax

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

Syntax

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

Syntax

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

Syntax

void addTaskListener (
com::sun::star::task::XTaskListener Listener );

Description

Add a task listener. If the task is already running, than the running method is called.


removeTaskListener

Syntax

void removeTaskListener (
com::sun::star::task::XTaskListener Listener );

Description

Remove a task listener.

Top of Page