public class WorkerContext extends Object implements javax.resource.spi.work.Work
WorkerContext
TODOModifier and Type | Field and Description |
---|---|
protected ClassLoader |
executionClassLoader |
protected static Log |
logger
logger used by this class
|
Constructor and Description |
---|
WorkerContext(javax.resource.spi.work.Work work)
Create a WorkWrapper.
|
WorkerContext(javax.resource.spi.work.Work aWork,
long aStartTimeout,
javax.resource.spi.work.ExecutionContext execContext,
javax.resource.spi.work.WorkListener workListener)
Create a WorkWrapper with the specified execution context.
|
Modifier and Type | Method and Description |
---|---|
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.
|
Latch |
provideEndLatch()
Provides a latch, which can be used to wait the end of a work execution.
|
Latch |
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.
|
String |
toString() |
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.
|
protected static final Log logger
protected ClassLoader executionClassLoader
public WorkerContext(javax.resource.spi.work.Work work)
work
- Work to be wrapped.public WorkerContext(javax.resource.spi.work.Work aWork, long aStartTimeout, javax.resource.spi.work.ExecutionContext execContext, javax.resource.spi.work.WorkListener workListener)
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,public void release()
release
in interface javax.resource.spi.work.Work
public void setThreadPriority(int aPriority)
aPriority
- Priority of the thread to be used to process the wrapped Work
instance.public int getThreadPriority()
public void workAccepted(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 Latch provideStartLatch()
public Latch provideEndLatch()
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.