Class 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
    • Field Summary

      • Fields inherited from interface jakarta.resource.spi.work.WorkManager

        IMMEDIATE, INDEFINITE, UNKNOWN
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void cleanUp()  
      void doWork​(jakarta.resource.spi.work.Work work)
      Executes the work instance.
      void doWork​(jakarta.resource.spi.work.Work work, long startTimeout, jakarta.resource.spi.work.ExecutionContext execContext, jakarta.resource.spi.work.WorkListener workListener)
      Executes the work instance.
      void scheduleWork​(jakarta.resource.spi.work.Work work)
      Executes the work instance.
      void scheduleWork​(jakarta.resource.spi.work.Work work, long startTimeout, jakarta.resource.spi.work.ExecutionContext execContext, jakarta.resource.spi.work.WorkListener workListener)
      Executes the work instance.
      long startWork​(jakarta.resource.spi.work.Work work)
      Executes the work instance.
      long startWork​(jakarta.resource.spi.work.Work work, long startTimeout, jakarta.resource.spi.work.ExecutionContext execContext, jakarta.resource.spi.work.WorkListener workListener)
      Executes the work instance.
    • Method Detail

      • cleanUp

        public void cleanUp()
      • doWork

        public void doWork​(jakarta.resource.spi.work.Work work)
                    throws jakarta.resource.spi.work.WorkException
        Executes the work instance.
        Specified by:
        doWork in interface jakarta.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.WorkException
        Executes the work instance. The calling thread will wait until the end of work execution.
        Specified by:
        doWork in interface jakarta.resource.spi.work.WorkManager
        Parameters:
        work - work instance from resource adapter
        startTimeout - 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.WorkException
        Executes the work instance. The calling thread will wait until the start of work execution.
        Specified by:
        startWork in interface jakarta.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.WorkException
        Executes the work instance. The calling thread will wait until the start of work execution.
        Specified by:
        startWork in interface jakarta.resource.spi.work.WorkManager
        Parameters:
        work - work instance from resource adapter
        startTimeout - 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.WorkException
        Executes the work instance. Calling thread will continue after scheduling the work
        Specified by:
        scheduleWork in interface jakarta.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.WorkException
        Executes the work instance. Calling thread will continue after scheduling the work
        Specified by:
        scheduleWork in interface jakarta.resource.spi.work.WorkManager
        Parameters:
        work - work instance from resource adapter
        startTimeout - 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.