org.jboss.jca.core.workmanager
Class WorkManagerImpl

java.lang.Object
  extended by org.jboss.jca.core.workmanager.WorkManagerImpl
All Implemented Interfaces:
Cloneable, javax.resource.spi.work.WorkManager, org.jboss.jca.core.spi.graceful.GracefulShutdown

public class WorkManagerImpl
extends Object
implements org.jboss.jca.core.api.workmanager.WorkManager

The work manager implementation.

Author:
Jesper Pedersen

Field Summary
 
Fields inherited from interface javax.resource.spi.work.WorkManager
IMMEDIATE, INDEFINITE, UNKNOWN
 
Constructor Summary
WorkManagerImpl()
          Constructor - by default the WorkManager is running in spec-compliant mode
 
Method Summary
 org.jboss.jca.core.api.workmanager.WorkManager clone()
          Clone the WorkManager implementation
 void doWork(javax.resource.spi.work.Work work)
          
 void doWork(javax.resource.spi.work.Work work, long startTimeout, javax.resource.spi.work.ExecutionContext execContext, javax.resource.spi.work.WorkListener workListener)
          
 org.jboss.jca.core.spi.security.Callback getCallbackSecurity()
          Get the callback security module
 org.jboss.threads.BlockingExecutor getLongRunningThreadPool()
          Retrieve the executor for long running tasks
 org.jboss.threads.BlockingExecutor getShortRunningThreadPool()
          Retrieve the executor for short running tasks
 org.jboss.jca.core.spi.transaction.xa.XATerminator getXATerminator()
          Get the XATerminator
 boolean isShutdown()
          
 boolean isSpecCompliant()
          Is spec compliant
 void prepareShutdown()
          
 void scheduleWork(javax.resource.spi.work.Work work)
          
 void scheduleWork(javax.resource.spi.work.Work work, long startTimeout, javax.resource.spi.work.ExecutionContext execContext, javax.resource.spi.work.WorkListener workListener)
          
 void setCallbackSecurity(org.jboss.jca.core.spi.security.Callback v)
          Set callback security module
 void setLongRunningThreadPool(org.jboss.threads.BlockingExecutor executor)
          Set the executor for long running tasks
 void setShortRunningThreadPool(org.jboss.threads.BlockingExecutor executor)
          Set the executor for short running tasks
 void setSpecCompliant(boolean v)
          Set spec compliant flag
 void setXATerminator(org.jboss.jca.core.spi.transaction.xa.XATerminator xaTerminator)
          Set the XATerminator
 void shutdown()
          
 long startWork(javax.resource.spi.work.Work work)
          
 long startWork(javax.resource.spi.work.Work work, long startTimeout, javax.resource.spi.work.ExecutionContext execContext, javax.resource.spi.work.WorkListener workListener)
          
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkManagerImpl

public WorkManagerImpl()
Constructor - by default the WorkManager is running in spec-compliant mode

Method Detail

getShortRunningThreadPool

public org.jboss.threads.BlockingExecutor getShortRunningThreadPool()
Retrieve the executor for short running tasks

Returns:
The executor

setShortRunningThreadPool

public void setShortRunningThreadPool(org.jboss.threads.BlockingExecutor executor)
Set the executor for short running tasks

Parameters:
executor - The executor

getLongRunningThreadPool

public org.jboss.threads.BlockingExecutor getLongRunningThreadPool()
Retrieve the executor for long running tasks

Returns:
The executor

setLongRunningThreadPool

public void setLongRunningThreadPool(org.jboss.threads.BlockingExecutor executor)
Set the executor for long running tasks

Parameters:
executor - The executor

getXATerminator

public org.jboss.jca.core.spi.transaction.xa.XATerminator getXATerminator()
Get the XATerminator

Returns:
The XA terminator

setXATerminator

public void setXATerminator(org.jboss.jca.core.spi.transaction.xa.XATerminator xaTerminator)
Set the XATerminator

Parameters:
xaTerminator - The XA terminator

isSpecCompliant

public boolean isSpecCompliant()
Is spec compliant

Returns:
True if spec compliant; otherwise false

setSpecCompliant

public void setSpecCompliant(boolean v)
Set spec compliant flag

Parameters:
v - The value

getCallbackSecurity

public org.jboss.jca.core.spi.security.Callback getCallbackSecurity()
Get the callback security module

Returns:
The value

setCallbackSecurity

public void setCallbackSecurity(org.jboss.jca.core.spi.security.Callback v)
Set callback security module

Parameters:
v - The value

clone

public org.jboss.jca.core.api.workmanager.WorkManager clone()
                                                     throws CloneNotSupportedException
Clone the WorkManager implementation

Overrides:
clone in class Object
Returns:
A copy of the implementation
Throws:
CloneNotSupportedException - Thrown if the copy operation isn't supported

doWork

public void doWork(javax.resource.spi.work.Work work)
            throws javax.resource.spi.work.WorkException

Specified by:
doWork in interface javax.resource.spi.work.WorkManager
Throws:
javax.resource.spi.work.WorkException

doWork

public void doWork(javax.resource.spi.work.Work work,
                   long startTimeout,
                   javax.resource.spi.work.ExecutionContext execContext,
                   javax.resource.spi.work.WorkListener workListener)
            throws javax.resource.spi.work.WorkException

Specified by:
doWork in interface javax.resource.spi.work.WorkManager
Throws:
javax.resource.spi.work.WorkException

startWork

public long startWork(javax.resource.spi.work.Work work)
               throws javax.resource.spi.work.WorkException

Specified by:
startWork in interface javax.resource.spi.work.WorkManager
Throws:
javax.resource.spi.work.WorkException

startWork

public long startWork(javax.resource.spi.work.Work work,
                      long startTimeout,
                      javax.resource.spi.work.ExecutionContext execContext,
                      javax.resource.spi.work.WorkListener workListener)
               throws javax.resource.spi.work.WorkException

Specified by:
startWork in interface javax.resource.spi.work.WorkManager
Throws:
javax.resource.spi.work.WorkException

scheduleWork

public void scheduleWork(javax.resource.spi.work.Work work)
                  throws javax.resource.spi.work.WorkException

Specified by:
scheduleWork in interface javax.resource.spi.work.WorkManager
Throws:
javax.resource.spi.work.WorkException

scheduleWork

public void scheduleWork(javax.resource.spi.work.Work work,
                         long startTimeout,
                         javax.resource.spi.work.ExecutionContext execContext,
                         javax.resource.spi.work.WorkListener workListener)
                  throws javax.resource.spi.work.WorkException

Specified by:
scheduleWork in interface javax.resource.spi.work.WorkManager
Throws:
javax.resource.spi.work.WorkException

prepareShutdown

public void prepareShutdown()

Specified by:
prepareShutdown in interface org.jboss.jca.core.spi.graceful.GracefulShutdown

shutdown

public void shutdown()

Specified by:
shutdown in interface org.jboss.jca.core.spi.graceful.GracefulShutdown

isShutdown

public boolean isShutdown()

Specified by:
isShutdown in interface org.jboss.jca.core.spi.graceful.GracefulShutdown


Copyright © 2008 Red Hat Middleware LLC (http://www.jboss.com/)