org.objectweb.easybeans.jca.workmanager
Class ResourceWork

java.lang.Object
  extended by org.objectweb.easybeans.jca.workmanager.ResourceWork

public class ResourceWork
extends java.lang.Object

This class defines a work of the JCA API by adding some properties around this work.

Author:
Philippe Durieux (JOnAS), Florent Benoit (EasyBeans)

Field Summary
private  long creationTime
          Creation of this object.
private  javax.resource.spi.work.ExecutionContext executionContext
          JCA Execution context (contains information about transactions).
private static JLog logger
          Logger.
private  boolean started
          This work has been started or not ? (default = false).
private  long timeout
          Timeout for the given work.
private  javax.resource.spi.work.Work work
          Work object that is wrapped.
private  javax.resource.spi.work.WorkListener workListener
          Listener that is notified when work are accepted/rejected/started/completed.
 
Constructor Summary
ResourceWork(javax.resource.spi.work.Work work, long timeout, javax.resource.spi.work.ExecutionContext executionContext, javax.resource.spi.work.WorkListener workListener)
          Default constructor : build a wrapper around the given work.
 
Method Summary
 long getCreationTime()
           
 javax.resource.spi.work.ExecutionContext getExecutionContext()
           
 long getTimeout()
           
 javax.resource.spi.work.Work getWork()
           
 javax.resource.spi.work.WorkListener getWorkListener()
           
 boolean isStarted()
           
 void setStarted()
          Sets the started mode to true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static JLog logger
Logger.


work

private javax.resource.spi.work.Work work
Work object that is wrapped.


timeout

private long timeout
Timeout for the given work.


executionContext

private javax.resource.spi.work.ExecutionContext executionContext
JCA Execution context (contains information about transactions).


workListener

private javax.resource.spi.work.WorkListener workListener
Listener that is notified when work are accepted/rejected/started/completed.


creationTime

private long creationTime
Creation of this object.


started

private boolean started
This work has been started or not ? (default = false).

Constructor Detail

ResourceWork

public ResourceWork(javax.resource.spi.work.Work work,
                    long timeout,
                    javax.resource.spi.work.ExecutionContext executionContext,
                    javax.resource.spi.work.WorkListener workListener)
Default constructor : build a wrapper around the given work.

Parameters:
work - the given work
timeout - the timeout of this work
executionContext - the context for the given work
workListener - the listener on this work object
Method Detail

getWork

public javax.resource.spi.work.Work getWork()
Returns:
the work object

getTimeout

public long getTimeout()
Returns:
the timeout of this object

getExecutionContext

public javax.resource.spi.work.ExecutionContext getExecutionContext()
Returns:
the execution context of this work

getWorkListener

public javax.resource.spi.work.WorkListener getWorkListener()
Returns:
the listener of this work.

getCreationTime

public long getCreationTime()
Returns:
the creation time of this object.

isStarted

public boolean isStarted()
Returns:
true if the work has been started, else false.

setStarted

public void setStarted()
Sets the started mode to true.