org.jboss.resource.work
Class JBossWorkManager

java.lang.Object
  extended by org.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended by org.jboss.system.ServiceMBeanSupport
          extended by org.jboss.resource.work.JBossWorkManager
All Implemented Interfaces:
javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, javax.resource.spi.work.WorkManager, JBossWorkManagerMBean, org.jboss.system.Service, org.jboss.system.ServiceMBean

public class JBossWorkManager
extends org.jboss.system.ServiceMBeanSupport
implements javax.resource.spi.work.WorkManager, JBossWorkManagerMBean

The work manager implementation

Version:
$Revision: 57189 $
Author:
Adrian Brock

Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface javax.resource.spi.work.WorkManager
IMMEDIATE, INDEFINITE, UNKNOWN
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
JBossWorkManager()
           
 
Method Summary
protected  void cancelWork(WorkWrapper wrapper)
          Cancel work
 void doWork(javax.resource.spi.work.Work work)
           
 void doWork(javax.resource.spi.work.Work work, long startTimeout, javax.resource.spi.work.ExecutionContext ctx, javax.resource.spi.work.WorkListener listener)
           
protected  void endWork(WorkWrapper wrapper)
          End work
protected  void executeWork(WorkWrapper wrapper)
          Execute the work
 javax.resource.spi.work.WorkManager getInstance()
          Get the reference to this work manager
 org.jboss.util.threadpool.ThreadPool getThreadPool()
          Retrieve the thread pool
 javax.management.ObjectName getThreadPoolName()
          Get the thread pool name
 javax.management.ObjectName getXATerminatorName()
          Get the XATerminator
protected  void importWork(WorkWrapper wrapper)
          Import any work
 void scheduleWork(javax.resource.spi.work.Work work)
           
 void scheduleWork(javax.resource.spi.work.Work work, long startTimeout, javax.resource.spi.work.ExecutionContext ctx, javax.resource.spi.work.WorkListener listener)
           
 void setThreadPool(org.jboss.util.threadpool.ThreadPool threadPool)
          Set the thread pool
 void setThreadPoolName(javax.management.ObjectName threadPoolName)
          Set the thread pool name
 void setXATerminatorName(javax.management.ObjectName xaTerminatorName)
          Set the xa terminator
protected  void startService()
           
 long startWork(javax.resource.spi.work.Work work)
           
 long startWork(javax.resource.spi.work.Work work, long startTimeout, javax.resource.spi.work.ExecutionContext ctx, javax.resource.spi.work.WorkListener listener)
           
protected  void startWork(WorkWrapper wrapper)
          Start work
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, createService, destroy, destroyService, getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop, stopService
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Constructor Detail

JBossWorkManager

public JBossWorkManager()
Method Detail

getThreadPool

public org.jboss.util.threadpool.ThreadPool getThreadPool()
Retrieve the thread pool

Returns:
the thread pool

setThreadPool

public void setThreadPool(org.jboss.util.threadpool.ThreadPool threadPool)
Set the thread pool

Parameters:
threadPool - the thread pool

getThreadPoolName

public javax.management.ObjectName getThreadPoolName()
Description copied from interface: JBossWorkManagerMBean
Get the thread pool name

Specified by:
getThreadPoolName in interface JBossWorkManagerMBean
Returns:
the thread pool name

setThreadPoolName

public void setThreadPoolName(javax.management.ObjectName threadPoolName)
Description copied from interface: JBossWorkManagerMBean
Set the thread pool name

Specified by:
setThreadPoolName in interface JBossWorkManagerMBean
Parameters:
threadPoolName - the thread pool name

getXATerminatorName

public javax.management.ObjectName getXATerminatorName()
Description copied from interface: JBossWorkManagerMBean
Get the XATerminator

Specified by:
getXATerminatorName in interface JBossWorkManagerMBean
Returns:
the xa terminator

setXATerminatorName

public void setXATerminatorName(javax.management.ObjectName xaTerminatorName)
Description copied from interface: JBossWorkManagerMBean
Set the xa terminator

Specified by:
setXATerminatorName in interface JBossWorkManagerMBean
Parameters:
xaTerminatorName - the xa terminator name

getInstance

public javax.resource.spi.work.WorkManager getInstance()
Description copied from interface: JBossWorkManagerMBean
Get the reference to this work manager

Specified by:
getInstance in interface JBossWorkManagerMBean
Returns:
the work manager

doWork

public void doWork(javax.resource.spi.work.Work work,
                   long startTimeout,
                   javax.resource.spi.work.ExecutionContext ctx,
                   javax.resource.spi.work.WorkListener listener)
            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)
            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,
                      long startTimeout,
                      javax.resource.spi.work.ExecutionContext ctx,
                      javax.resource.spi.work.WorkListener listener)
               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)
               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,
                         long startTimeout,
                         javax.resource.spi.work.ExecutionContext ctx,
                         javax.resource.spi.work.WorkListener listener)
                  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)
                  throws javax.resource.spi.work.WorkException
Specified by:
scheduleWork in interface javax.resource.spi.work.WorkManager
Throws:
javax.resource.spi.work.WorkException

startService

protected void startService()
                     throws Exception
Overrides:
startService in class org.jboss.system.ServiceMBeanSupport
Throws:
Exception

importWork

protected void importWork(WorkWrapper wrapper)
                   throws javax.resource.spi.work.WorkException
Import any work

Parameters:
wrapper - the work wrapper
Throws:
javax.resource.spi.work.WorkException - for any error

executeWork

protected void executeWork(WorkWrapper wrapper)
                    throws javax.resource.spi.work.WorkException
Execute the work

Parameters:
wrapper - the work wrapper
Throws:
javax.resource.spi.work.WorkException - for any error

startWork

protected void startWork(WorkWrapper wrapper)
                  throws javax.resource.spi.work.WorkException
Start work

Parameters:
wrapper - the work wrapper
Throws:
javax.resource.spi.work.WorkException - for any error

endWork

protected void endWork(WorkWrapper wrapper)
End work

Parameters:
wrapper - the work wrapper
Throws:
javax.resource.spi.work.WorkException - for any error

cancelWork

protected void cancelWork(WorkWrapper wrapper)
Cancel work

Parameters:
wrapper - the work wrapper
Throws:
javax.resource.spi.work.WorkException - for any error


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.