org.apache.tuscany.sca.work
Interface WorkScheduler

All Known Implementing Classes:
Jsr237WorkScheduler

public interface WorkScheduler

Defines the contract for scheduling asynchronous units of work.

Units of work can be scheduled with an optional NotificationListener. If a notification listener is specified, the caller will be notified regarding the status of the work. The unit of work can either be completed, rejected or completed with an error. If the work completed with an error, the caller is notified with the error details.


Method Summary
 void destroy()
          Destroys the work scheduler
<T extends java.lang.Runnable>
void
scheduleWork(T work)
          Schedules a unit of work for future execution.
<T extends java.lang.Runnable>
void
scheduleWork(T work, NotificationListener<T> listener)
          Schedules a unit of work for future execution.
 

Method Detail

scheduleWork

<T extends java.lang.Runnable> void scheduleWork(T work,
                                                 NotificationListener<T> listener)
Schedules a unit of work for future execution. The notification listener is used to register interest in callbacks regarding the status of the work.

Parameters:
work - The unit of work that needs to be asynchronously executed.
listener - Notification listener for callbacks.

scheduleWork

<T extends java.lang.Runnable> void scheduleWork(T work)
Schedules a unit of work for future execution. The notification listener is used to register interest in callbacks regarding the status of the work.

Parameters:
work - The unit of work that needs to be asynchronously executed.

destroy

void destroy()
Destroys the work scheduler