Home » geronimo-2.2-source-release » org.apache.geronimo.connector.work » [javadoc | source]
org.apache.geronimo.connector.work
public class: WorkerContext [javadoc | source]
java.lang.Object
   org.apache.geronimo.connector.work.WorkerContext

All Implemented Interfaces:
    javax.resource.spi.work.Work

Work wrapper providing an execution context to a Work instance.
Constructor:
 public WorkerContext(Work work,
    TransactionContextManager transactionContextManager) 
    Create a WorkWrapper.
    Parameters:
    work - Work to be wrapped.
    transactionContextManager -
 public WorkerContext(Work aWork,
    long aStartTimeout,
    ExecutionContext execContext,
    TransactionContextManager transactionContextManager,
    WorkListener workListener) 
    Create a WorkWrapper with the specified execution context.
    Parameters:
    aWork - Work to be wrapped.
    aStartTimeout - a time duration (in milliseconds) within which the execution of the Work instance must start.
    execContext - an object containing the execution context with which the submitted Work instance must be executed.
    workListener - an object which would be notified when the various Work processing events (work accepted, work rejected, work started,
Method from org.apache.geronimo.connector.work.WorkerContext Summary:
getAcceptedTime,   getStartTimeout,   getThreadPriority,   getWorkException,   isTimedOut,   provideEndLatch,   provideStartLatch,   release,   run,   setThreadPriority,   toString,   workAccepted
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.geronimo.connector.work.WorkerContext Detail:
 public synchronized long getAcceptedTime() 
    System.currentTimeMillis() when the Work has been accepted. This method can be used to compute the duration of a work.
 public long getStartTimeout() 
    Gets the time duration (in milliseconds) within which the execution of the Work instance must start.
 public int getThreadPriority() 
    Gets the priority level of the thread, which will be dispatched to process this work. This priority level must be the same one for a given resource adapter.
 public synchronized WorkException getWorkException() 
    Gets the WorkException, if any, thrown during the execution.
 public synchronized boolean isTimedOut() 
    Used by a Work executor in order to know if this work, which should be accepted but not started has timed out. This method MUST be called prior to retry the execution of a Work.
 public synchronized Latch provideEndLatch() 
    Provides a latch, which can be used to wait the end of a work execution.
 public synchronized Latch provideStartLatch() 
    Provides a latch, which can be used to wait the start of a work execution.
 public  void release() 
 public  void run() 
 public  void setThreadPriority(int aPriority) 
    Defines the thread priority level of the thread, which will be dispatched to process this work. This priority level must be the same one for a given resource adapter.
 public String toString() 
 public synchronized  void workAccepted(Object anObject) 
    Call-back method used by a Work executor in order to notify this instance that the wrapped Work instance has been accepted.