public final class WorkCoordinator extends Object
| Constructor and Description |
|---|
WorkCoordinator(javax.resource.spi.work.Work work,
long timeout,
javax.resource.spi.work.ExecutionContext ec,
com.sun.corba.ee.spi.threadpool.WorkQueue queue,
javax.resource.spi.work.WorkListener listener,
WorkManagementProbeProvider probeProvider,
ConnectorRuntime runtime,
String raName,
WorkContextHandlerImpl handler)
Constructs a coordinator
|
| Modifier and Type | Method and Description |
|---|---|
javax.resource.spi.work.WorkException |
getException()
Retrieves the exception created during the work's execution.
|
static javax.resource.spi.work.ExecutionContext |
getExecutionContext(javax.resource.spi.work.ExecutionContext ec,
javax.resource.spi.work.Work work) |
String |
getRAName() |
int |
getState()
Retrieves the state of the work coordinator object.
|
static int |
increaseSeed() |
boolean |
isTimedOut() |
void |
lock()
Lock the thread upto the end of execution or start of work
execution.
|
void |
postInvoke()
Post-invoke operation.
|
void |
preInvoke()
Pre-invoke operation.
|
boolean |
proceed()
Checks the work is good to proceed with further processing.
|
void |
setException(Throwable e)
Accepts an exception object and converts to a
WorkException object. |
void |
setState(int state)
Sets the state of the work coordinator object
|
void |
setupContext(OneWork oneWork) |
void |
submitWork(int waitModeValue)
Submits the work to the queue and generates a work accepted event.
|
String |
toString()
Returns the string representation of WorkCoordinator.
|
public WorkCoordinator(javax.resource.spi.work.Work work,
long timeout,
javax.resource.spi.work.ExecutionContext ec,
com.sun.corba.ee.spi.threadpool.WorkQueue queue,
javax.resource.spi.work.WorkListener listener,
WorkManagementProbeProvider probeProvider,
ConnectorRuntime runtime,
String raName,
WorkContextHandlerImpl handler)
work - A work object as submitted by the resource adaptertimeout - timeout for the work instanceec - ExecutionContext object.queue - WorkQueue of the threadpool, to which the work
will be submittedlistener - WorkListener object from the resource adapter.public String getRAName()
public void submitWork(int waitModeValue)
public void preInvoke()
1. Notifies the WorkManager.startWork method.
2. Checks whether the wok has already been timed out.
3. Recreates the transaction with JTS.
public void setupContext(OneWork oneWork) throws javax.resource.spi.work.WorkException
javax.resource.spi.work.WorkExceptionpublic void postInvoke()
1. Releases the transaction with JTS. 2. Generates work completed event. 3. Clear the thread context.
public boolean proceed()
public boolean isTimedOut()
public javax.resource.spi.work.WorkException getException()
WorkException object.public void setException(Throwable e)
WorkException object.e - Throwable object.public void lock()
public String toString()
public void setState(int state)
state - CREATED or Either STARTED or COMPLETED or TIMEDOUTpublic int getState()
public static javax.resource.spi.work.ExecutionContext getExecutionContext(javax.resource.spi.work.ExecutionContext ec,
javax.resource.spi.work.Work work)
public static int increaseSeed()
Copyright © 2017. All rights reserved.