|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.geronimo.connector.work.WorkerContext
public class WorkerContext
Work wrapper providing an execution context to a Work instance.
| Constructor Summary | |
|---|---|
WorkerContext(javax.resource.spi.work.Work work,
java.util.Collection<WorkContextHandler> workContextHandlers)
Create a WorkWrapper. |
|
WorkerContext(javax.resource.spi.work.Work aWork,
long aStartTimeout,
javax.resource.spi.work.ExecutionContext execContext,
javax.resource.spi.work.WorkListener workListener,
java.util.Collection<WorkContextHandler> workContextHandlers)
Create a WorkWrapper with the specified execution context. |
|
| Method Summary | |
|---|---|
long |
getAcceptedTime()
System.currentTimeMillis() when the Work has been accepted. |
long |
getStartTimeout()
Gets the time duration (in milliseconds) within which the execution of the Work instance must start. |
int |
getThreadPriority()
Gets the priority level of the thread, which will be dispatched to process this work. |
javax.resource.spi.work.WorkException |
getWorkException()
Gets the WorkException, if any, thrown during the execution. |
boolean |
isTimedOut()
Used by a Work executor in order to know if this work, which should be accepted but not started has timed out. |
java.util.concurrent.CountDownLatch |
provideEndLatch()
Provides a latch, which can be used to wait the end of a work execution. |
java.util.concurrent.CountDownLatch |
provideStartLatch()
Provides a latch, which can be used to wait the start of a work execution. |
void |
release()
|
void |
run()
|
void |
setThreadPriority(int aPriority)
Defines the thread priority level of the thread, which will be dispatched to process this work. |
java.lang.String |
toString()
|
void |
workAccepted(java.lang.Object anObject)
Call-back method used by a Work executor in order to notify this instance that the wrapped Work instance has been accepted. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public WorkerContext(javax.resource.spi.work.Work work,
java.util.Collection<WorkContextHandler> workContextHandlers)
work - Work to be wrapped.workContextHandlers - WorkContextHandlers supported by this work manager
public WorkerContext(javax.resource.spi.work.Work aWork,
long aStartTimeout,
javax.resource.spi.work.ExecutionContext execContext,
javax.resource.spi.work.WorkListener workListener,
java.util.Collection<WorkContextHandler> workContextHandlers)
throws javax.resource.spi.work.WorkRejectedException
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 variousworkContextHandlers - WorkContextHandlers supported by this work manager
javax.resource.spi.work.WorkRejectedException - if executionContext supplied yet Work implements WorkContextProvider| Method Detail |
|---|
public void release()
release in interface javax.resource.spi.work.Workpublic void setThreadPriority(int aPriority)
aPriority - Priority of the thread to be used to process the wrapped
Work instance.public int getThreadPriority()
public void workAccepted(java.lang.Object anObject)
anObject - Object on which the event initially occurred. It should
be the work executor.public long getAcceptedTime()
public long getStartTimeout()
public boolean isTimedOut()
public javax.resource.spi.work.WorkException getWorkException()
public void run()
run in interface java.lang.Runnablepublic java.util.concurrent.CountDownLatch provideStartLatch()
public java.util.concurrent.CountDownLatch provideEndLatch()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||