Class CommonWorkManager
- java.lang.Object
-
- com.sun.enterprise.connectors.work.CommonWorkManager
-
- All Implemented Interfaces:
jakarta.resource.spi.work.WorkManager
public final class CommonWorkManager extends Object implements jakarta.resource.spi.work.WorkManager
WorkManager implementation.- Author:
- Binod P.G
-
-
Constructor Summary
Constructors Constructor Description CommonWorkManager(String threadPoolId, ConnectorRuntime runtime, String raName, ClassLoader cl)Private constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanUp()voiddoWork(jakarta.resource.spi.work.Work work)Executes the work instance.voiddoWork(jakarta.resource.spi.work.Work work, long startTimeout, jakarta.resource.spi.work.ExecutionContext execContext, jakarta.resource.spi.work.WorkListener workListener)Executes the work instance.voidscheduleWork(jakarta.resource.spi.work.Work work)Executes the work instance.voidscheduleWork(jakarta.resource.spi.work.Work work, long startTimeout, jakarta.resource.spi.work.ExecutionContext execContext, jakarta.resource.spi.work.WorkListener workListener)Executes the work instance.longstartWork(jakarta.resource.spi.work.Work work)Executes the work instance.longstartWork(jakarta.resource.spi.work.Work work, long startTimeout, jakarta.resource.spi.work.ExecutionContext execContext, jakarta.resource.spi.work.WorkListener workListener)Executes the work instance.
-
-
-
Constructor Detail
-
CommonWorkManager
public CommonWorkManager(String threadPoolId, ConnectorRuntime runtime, String raName, ClassLoader cl) throws ConnectorRuntimeException
Private constructor.- Parameters:
threadPoolId- Id of the thread pool.- Throws:
ConnectorRuntimeException- if thread pool is not accessible
-
-
Method Detail
-
cleanUp
public void cleanUp()
-
doWork
public void doWork(jakarta.resource.spi.work.Work work) throws jakarta.resource.spi.work.WorkExceptionExecutes the work instance.- Specified by:
doWorkin interfacejakarta.resource.spi.work.WorkManager- Parameters:
work- work instance from resource adapter- Throws:
jakarta.resource.spi.work.WorkException- if there is an exception while executing work.
-
doWork
public void doWork(jakarta.resource.spi.work.Work work, long startTimeout, jakarta.resource.spi.work.ExecutionContext execContext, jakarta.resource.spi.work.WorkListener workListener) throws jakarta.resource.spi.work.WorkExceptionExecutes the work instance. The calling thread will wait until the end of work execution.- Specified by:
doWorkin interfacejakarta.resource.spi.work.WorkManager- Parameters:
work- work instance from resource adapterstartTimeout- Timeout for the work.execContext- Execution context in which the work will be executed.workListener- Listener from RA that will listen to work events.- Throws:
jakarta.resource.spi.work.WorkException- if there is an exception while executing work.
-
startWork
public long startWork(jakarta.resource.spi.work.Work work) throws jakarta.resource.spi.work.WorkExceptionExecutes the work instance. The calling thread will wait until the start of work execution.- Specified by:
startWorkin interfacejakarta.resource.spi.work.WorkManager- Parameters:
work- work instance from resource adapter- Throws:
jakarta.resource.spi.work.WorkException- if there is an exception while executing work.
-
startWork
public long startWork(jakarta.resource.spi.work.Work work, long startTimeout, jakarta.resource.spi.work.ExecutionContext execContext, jakarta.resource.spi.work.WorkListener workListener) throws jakarta.resource.spi.work.WorkExceptionExecutes the work instance. The calling thread will wait until the start of work execution.- Specified by:
startWorkin interfacejakarta.resource.spi.work.WorkManager- Parameters:
work- work instance from resource adapterstartTimeout- Timeout for the work.execContext- Execution context in which the work will be executed.workListener- Listener from RA that will listen to work events.- Throws:
jakarta.resource.spi.work.WorkException- if there is an exception while executing work.
-
scheduleWork
public void scheduleWork(jakarta.resource.spi.work.Work work) throws jakarta.resource.spi.work.WorkExceptionExecutes the work instance. Calling thread will continue after scheduling the work- Specified by:
scheduleWorkin interfacejakarta.resource.spi.work.WorkManager- Parameters:
work- work instance from resource adapter- Throws:
jakarta.resource.spi.work.WorkException- if there is an exception while executing work.
-
scheduleWork
public void scheduleWork(jakarta.resource.spi.work.Work work, long startTimeout, jakarta.resource.spi.work.ExecutionContext execContext, jakarta.resource.spi.work.WorkListener workListener) throws jakarta.resource.spi.work.WorkExceptionExecutes the work instance. Calling thread will continue after scheduling the work- Specified by:
scheduleWorkin interfacejakarta.resource.spi.work.WorkManager- Parameters:
work- work instance from resource adapterstartTimeout- Timeout for the work.execContext- Execution context in which the work will be executed.workListener- Listener from RA that will listen to work events.- Throws:
jakarta.resource.spi.work.WorkException- if there is an exception while executing work.
-
-