org.apache.tuscany.sca.work
Interface NotificationListener<T extends java.lang.Runnable>


public interface NotificationListener<T extends java.lang.Runnable>

A callback inyterface that can be optionally used for registering interest in status of asynchronously scheduled unit of work.


Method Summary
 void workAccepted(T work)
          Callback method when the unit of work is accepted.
 void workCompleted(T work)
          Callback method when the unit of work is successfully completed.
 void workFailed(T work, java.lang.Throwable error)
          Callnack when the unit of work fails to complete.
 void workRejected(T work)
          Callback when the unit of work is rejected.
 void workStarted(T work)
          Callback when the unit of work is started.
 

Method Detail

workAccepted

void workAccepted(T work)
Callback method when the unit of work is accepted.

Parameters:
work - Work that was accepted.

workCompleted

void workCompleted(T work)
Callback method when the unit of work is successfully completed.

Parameters:
work - Work that was succesfully completed.

workStarted

void workStarted(T work)
Callback when the unit of work is started.

Parameters:
work - Unit of work that was started.

workRejected

void workRejected(T work)
Callback when the unit of work is rejected.

Parameters:
work - Unit of work that was rejected.

workFailed

void workFailed(T work,
                java.lang.Throwable error)
Callnack when the unit of work fails to complete.

Parameters:
work - Unit of work that failed to complete.
error - Error that caused the unit of work to fail.