public class WorkWrapper
extends java.lang.Object
implements java.lang.Runnable
Constructor and Description |
---|
WorkWrapper(WorkManagerImpl workManager,
javax.resource.spi.work.Work work,
javax.resource.spi.work.ExecutionContext executionContext,
javax.resource.spi.work.WorkListener workListener,
java.util.concurrent.CountDownLatch startedLatch,
java.util.concurrent.CountDownLatch completedLatch,
long startTime)
Create a new WorkWrapper
|
Modifier and Type | Method and Description |
---|---|
void |
addWorkContext(java.lang.Class<? extends javax.resource.spi.work.WorkContext> workContextClass,
javax.resource.spi.work.WorkContext workContext)
Adds new work context.
|
protected void |
cancel()
Cancel
|
protected void |
end()
End
|
javax.resource.spi.work.ExecutionContext |
getExecutionContext()
Retrieve the exection context
|
javax.resource.spi.work.Work |
getWork()
Retrieve the work
|
<T> T |
getWorkContext(java.lang.Class<T> workContextClass)
Returns work context instance.
|
javax.resource.spi.work.WorkException |
getWorkException()
Get any exception
|
javax.resource.spi.work.WorkListener |
getWorkListener()
Retrieve the work listener
|
WorkManager |
getWorkManager()
Get the work manager
|
void |
run()
Run
|
protected void |
start()
Start
|
java.lang.String |
toString()
String representation
|
public WorkWrapper(WorkManagerImpl workManager, javax.resource.spi.work.Work work, javax.resource.spi.work.ExecutionContext executionContext, javax.resource.spi.work.WorkListener workListener, java.util.concurrent.CountDownLatch startedLatch, java.util.concurrent.CountDownLatch completedLatch, long startTime)
workManager
- the work managerwork
- the workexecutionContext
- the execution contextworkListener
- the WorkListenerstartedLatch
- The latch for when work has startedcompletedLatch
- The latch for when work has completedstartTime
- The start timejava.lang.IllegalArgumentException
- for null work, execution context or a negative start timeoutpublic WorkManager getWorkManager()
public javax.resource.spi.work.Work getWork()
public javax.resource.spi.work.ExecutionContext getExecutionContext()
public javax.resource.spi.work.WorkListener getWorkListener()
public javax.resource.spi.work.WorkException getWorkException()
public void run()
run
in interface java.lang.Runnable
protected void start() throws javax.resource.spi.work.WorkException
javax.resource.spi.work.WorkException
- for any errorprotected void end()
protected void cancel()
public <T> T getWorkContext(java.lang.Class<T> workContextClass)
T
- class type infoworkContextClass
- work context typepublic void addWorkContext(java.lang.Class<? extends javax.resource.spi.work.WorkContext> workContextClass, javax.resource.spi.work.WorkContext workContext)
workContext
- new work contextworkContextClass
- work context classpublic java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2013 IronJacamar (http://www.ironjacamar.org)