FileDocCategorySizeDatePackage
OneWork.javaAPI DocGlassfish v2 API4034Fri May 04 22:34:26 BST 2007com.sun.enterprise.connectors.work

OneWork

public final class OneWork extends Object implements com.sun.corba.ee.spi.orbutil.threadpool.Work
Represents one piece of work that will be submitted to the workqueue.
author
Binod P.G

Fields Summary
private final javax.resource.spi.work.Work
work
private final WorkCoordinator
coordinator
private long
nqTime
private static final Logger
logger
Constructors Summary
OneWork(javax.resource.spi.work.Work work, WorkCoordinator coordinator)
Creates a work object that can be submitted to a workqueue.

param
work Actual work submitted by Resource adapter.
param
coordinator WorkCoordinator object.


                                
         
        this.work = work;
        this.coordinator = coordinator;
    
Methods Summary
public voiddoWork()
This method is executed by thread pool as the basic work operation.

        coordinator.preInvoke();
        if (coordinator.proceed()) {
            try {
                work.run();
            } catch (Throwable t) {
                coordinator.setException(t);
            }
        }
        coordinator.postInvoke();
    
public longgetEnqueueTime()
Retrieves the time at which this work is enqueued

return
Time in milliseconds.

        return nqTime;
    
public java.lang.StringgetName()
Retrieves the name of the work.

return
Name of the work.

        return "Resource adapter work";
    
public voidsetEnqueueTime(long tme)
Time at which this work is enqueued.

param
tme Time in milliseconds.

        this.nqTime = tme;
    
public java.lang.StringtoString()
Retrieves the string representation of work.

return
String representation of work.

        return (work.toString());