站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 j2ee API Documentation 英文版文档

WorkManager (JBoss J2EE API) - JBoss 4.0.1 sp1 j2ee API Documentation 英文版文档


javax.resource.spi.work
Interface WorkManager


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 work)
          Executes the work, the call blocks until the work completes
 void doWork(Work work, long startTimeout, ExecutionContext ctx, WorkListener listener)
          Executes the work, the call blocks until the work completes
 void scheduleWork(Work work)
          Executes the work, the call returns immediatley
 void scheduleWork(Work work, long startTimeout, ExecutionContext ctx, WorkListener listener)
          Executes the work, the call returns immediately
 long startWork(Work work)
          Executes the work, the call blocks until the work starts
 long startWork(Work work, long startTimeout, ExecutionContext ctx, WorkListener 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

IMMEDIATE

public static final long IMMEDIATE
No start delay

See Also:
Constant Field Values

INDEFINITE

public static final long INDEFINITE
Indefinite start delay

See Also:
Constant Field Values
Method Detail

doWork

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

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

doWork

public void doWork(Work work,
                   long startTimeout,
                   ExecutionContext ctx,
                   WorkListener listener)
            throws WorkException
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 - a generic error
WorkRejectedException - if the work is rejected
WorkCompletedException - if the work completes with an exception

startWork

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

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

startWork

public long startWork(Work work,
                      long startTimeout,
                      ExecutionContext ctx,
                      WorkListener listener)
               throws WorkException
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 - a generic error
WorkRejectedException - if the work is rejected

scheduleWork

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

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

scheduleWork

public void scheduleWork(Work work,
                         long startTimeout,
                         ExecutionContext ctx,
                         WorkListener listener)
                  throws WorkException
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 - a generic error
WorkRejectedException - if the work is rejected


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.