Methods Summary |
---|
protected void | cancelWork(WorkWrapper wrapper)Cancel work
if (trace)
log.trace("Cancel work " + wrapper);
ExecutionContext ctx = wrapper.getExecutionContext();
if (ctx != null)
{
Xid xid = ctx.getXid();
if (xid != null)
{
xaTerminator.cancelWork(wrapper.getWork(), xid);
}
}
if (trace)
log.trace("Canceled work " + wrapper);
|
public void | doWork(javax.resource.spi.work.Work work, long startTimeout, javax.resource.spi.work.ExecutionContext ctx, javax.resource.spi.work.WorkListener listener)
if (ctx == null)
ctx = new ExecutionContext();
WorkWrapper wrapper = new WorkWrapper(this, work, Task.WAIT_FOR_COMPLETE, startTimeout, ctx, listener);
importWork(wrapper);
executeWork(wrapper);
if (wrapper.getWorkException() != null)
throw wrapper.getWorkException();
|
public void | doWork(javax.resource.spi.work.Work work)
doWork(work, WorkManager.INDEFINITE, null, null);
|
protected void | endWork(WorkWrapper wrapper)End work
if (trace)
log.trace("Ending work " + wrapper);
ExecutionContext ctx = wrapper.getExecutionContext();
if (ctx != null)
{
Xid xid = ctx.getXid();
if (xid != null)
{
xaTerminator.endWork(wrapper.getWork(), xid);
}
}
if (trace)
log.trace("Ended work " + wrapper);
|
protected void | executeWork(WorkWrapper wrapper)Execute the work
if (trace)
log.trace("Submitting work to thread pool " + wrapper);
threadPool.runTaskWrapper(wrapper);
if (trace)
log.trace("Submitted work to thread pool " + wrapper);
|
public javax.resource.spi.work.WorkManager | getInstance()
return this;
|
public org.jboss.util.threadpool.ThreadPool | getThreadPool()Retrieve the thread pool
return threadPool;
|
public javax.management.ObjectName | getThreadPoolName()
return threadPoolName;
|
public javax.management.ObjectName | getXATerminatorName()
return xaTerminatorName;
|
protected void | importWork(WorkWrapper wrapper)Import any work
trace = log.isTraceEnabled();
if (trace)
log.trace("Importing work " + wrapper);
ExecutionContext ctx = wrapper.getExecutionContext();
if (ctx != null)
{
Xid xid = ctx.getXid();
if (xid != null)
{
//JBAS-4002 base value is in seconds as per the API, here we convert to millis
long timeout = (ctx.getTransactionTimeout() * 1000);
xaTerminator.registerWork(wrapper.getWork(), xid, timeout);
}
}
if (trace)
log.trace("Imported work " + wrapper);
|
public void | scheduleWork(javax.resource.spi.work.Work work, long startTimeout, javax.resource.spi.work.ExecutionContext ctx, javax.resource.spi.work.WorkListener listener)
if (ctx == null)
ctx = new ExecutionContext();
WorkWrapper wrapper = new WorkWrapper(this, work, Task.WAIT_NONE, startTimeout, ctx, listener);
importWork(wrapper);
executeWork(wrapper);
if (wrapper.getWorkException() != null)
throw wrapper.getWorkException();
|
public void | scheduleWork(javax.resource.spi.work.Work work)
scheduleWork(work, WorkManager.INDEFINITE, null, null);
|
public void | setThreadPool(org.jboss.util.threadpool.ThreadPool threadPool)Set the thread pool
this.threadPool = threadPool;
|
public void | setThreadPoolName(javax.management.ObjectName threadPoolName)
this.threadPoolName = threadPoolName;
|
public void | setXATerminatorName(javax.management.ObjectName xaTerminatorName)
this.xaTerminatorName = xaTerminatorName;
|
protected void | startService()
if (threadPoolName == null)
throw new IllegalStateException("No thread pool name");
threadPool = (ThreadPool) server.getAttribute(threadPoolName, "Instance");
if (xaTerminatorName == null)
throw new IllegalStateException("No xa terminator name");
xaTerminator = (JBossXATerminator) server.getAttribute(xaTerminatorName, "XATerminator");
|
public long | startWork(javax.resource.spi.work.Work work, long startTimeout, javax.resource.spi.work.ExecutionContext ctx, javax.resource.spi.work.WorkListener listener)
if (ctx == null)
ctx = new ExecutionContext();
WorkWrapper wrapper = new WorkWrapper(this, work, Task.WAIT_FOR_START, startTimeout, ctx, listener);
importWork(wrapper);
executeWork(wrapper);
if (wrapper.getWorkException() != null)
throw wrapper.getWorkException();
return wrapper.getBlockedElapsed();
|
public long | startWork(javax.resource.spi.work.Work work)
return startWork(work, WorkManager.INDEFINITE, null, null);
|
protected void | startWork(WorkWrapper wrapper)Start work
if (trace)
log.trace("Starting work " + wrapper);
ExecutionContext ctx = wrapper.getExecutionContext();
if (ctx != null)
{
Xid xid = ctx.getXid();
if (xid != null)
{
xaTerminator.startWork(wrapper.getWork(), xid);
}
}
if (trace)
log.trace("Started work " + wrapper);
|