Interface UnitOfWork


public interface UnitOfWork
Unit of Work allows to group related activities and operation into single unit. It it can be then completed or aborted as one making the execution consistent. Depending on the implementation it can rely on some additional frameworks or capabilities to carry on with the execution semantics.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Aborts this unit of work and ignores any awaiting work.
    void
    end()
    Completes this unit of work ensuring all awaiting work is invoked.
    Returns unique identifier of this unit of work
    void
    Intercepts work that should be done as part of this unit of work.
    default ProcessInstances<?>
    Allows to manage given implementation of process instances to provide up to date information for executed instances within unit of work
    void
    Initiates this unit of work if not already started.
  • Method Details

    • identifier

      String identifier()
      Returns unique identifier of this unit of work
      Returns:
      identifier of the unit of work
    • start

      void start()
      Initiates this unit of work if not already started. It is safe to call start multiple times unless the unit has already been completed or aborted.
    • end

      void end()
      Completes this unit of work ensuring all awaiting work is invoked.
    • abort

      void abort()
      Aborts this unit of work and ignores any awaiting work.
    • intercept

      void intercept(WorkUnit<?> work)
      Intercepts work that should be done as part of this unit of work.
      Parameters:
      work - actual work to be invoked as part of this unit of work.
    • managedProcessInstances

      default ProcessInstances<?> managedProcessInstances(Process<?> process, ProcessInstances<?> instances)
      Allows to manage given implementation of process instances to provide up to date information for executed instances within unit of work
      Parameters:
      process - definition of the process
      instances - concrete implementation of the ProcessInstances
      Returns:
      returns managed instance of the given ProcessInstances instance