javax.resource.spi.work
Interface WorkManager

All Known Implementing Classes:
JBossWorkManager (src)

public interface WorkManager

Interface used to associate the resource adapter with objects that implement this interface.


Field Summary
static long IMMEDIATE
          No start delay
static long INDEFINITE
          Indefinite start delay
static long UNKNOWN
          Unknown/unspecified start delay
 
Method Summary
 void doWork(Work (src)  work)
          Executes the work, the call blocks until the work completes
 void doWork(Work (src)  work, long startTimeout, ExecutionContext (src)  ctx, WorkListener (src)  listener)
          Executes the work, the call blocks until the work completes
 void scheduleWork(Work (src)  work)
          Executes the work, the call returns immediatley
 void scheduleWork(Work (src)  work, long startTimeout, ExecutionContext (src)  ctx, WorkListener (src)  listener)
          Executes the work, the call returns immediately
 long startWork(Work (src)  work)
          Executes the work, the call blocks until the work starts
 long startWork(Work (src)  work, long startTimeout, ExecutionContext (src)  ctx, WorkListener (src)  listener)
          Executes the work, the call blocks until the work starts
 

Field Detail

UNKNOWN

public static final long UNKNOWN
Unknown/unspecified start delay

See Also:
Constant Field Values (src)

IMMEDIATE

public static final long IMMEDIATE
No start delay

See Also:
Constant Field Values (src)

INDEFINITE

public static final long INDEFINITE
Indefinite start delay

See Also:
Constant Field Values (src)
Method Detail

doWork

public void doWork(Work (src)  work)
            throws WorkException (src) 
Executes the work, the call blocks until the work completes

Parameters:
work - the work
Throws:
WorkException (src) - a generic error
WorkRejectedException (src) - if the work is rejected
WorkCompletedException (src) - if the work completes with an exception

doWork

public void doWork(Work (src)  work,
                   long startTimeout,
                   ExecutionContext (src)  ctx,
                   WorkListener (src)  listener)
            throws WorkException (src) 
Executes the work, the call blocks until the work completes

Parameters:
work - the work
startTimeout - the wait before execution
ctx - the execution context
listener - the work listener
Throws:
WorkException (src) - a generic error
WorkRejectedException (src) - if the work is rejected
WorkCompletedException (src) - if the work completes with an exception

startWork

public long startWork(Work (src)  work)
               throws WorkException (src) 
Executes the work, the call blocks until the work starts

Parameters:
work - the work
Returns:
the time elapsed until the work starts
Throws:
WorkException (src) - a generic error
WorkRejectedException (src) - if the work is rejected

startWork

public long startWork(Work (src)  work,
                      long startTimeout,
                      ExecutionContext (src)  ctx,
                      WorkListener (src)  listener)
               throws WorkException (src) 
Executes the work, the call blocks until the work starts

Parameters:
work - the work
startTimeout - the wait before execution
ctx - the execution context
listener - the work listener
Returns:
the time elapsed until the work starts
Throws:
WorkException (src) - a generic error
WorkRejectedException (src) - if the work is rejected

scheduleWork

public void scheduleWork(Work (src)  work)
                  throws WorkException (src) 
Executes the work, the call returns immediatley

Parameters:
work - the work
Throws:
WorkException (src) - a generic error
WorkRejectedException (src) - if the work is rejected

scheduleWork

public void scheduleWork(Work (src)  work,
                         long startTimeout,
                         ExecutionContext (src)  ctx,
                         WorkListener (src)  listener)
                  throws WorkException (src) 
Executes the work, the call returns immediately

Parameters:
work - the work
startTimeout - the wait before execution
ctx - the execution context
listener - the work listener
Throws:
WorkException (src) - a generic error
WorkRejectedException (src) - if the work is rejected