Class CaptureDispatcher

java.lang.Object
com.axelor.workflow.trigger.CaptureDispatcher

public class CaptureDispatcher extends Object
Dispatches durable record changes under fenced leases, completing with the database work.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Dispatch every envelope in ids, each in its own transaction so one record's rollback cannot discard the others' work, all inside one re-entrancy guard context.
    pendingIds(int limit)
    Ids of envelopes nothing has taken, oldest first.
    boolean
    reconcile(Long id, boolean replay, String reason)
    An administrator has checked the external systems and decides whether the event may be replayed.
    int
    Return safe abandoned work to the queue and retain ambiguous effects for reconciliation.
    int
    Delete dispatched envelopes past their retention; the run they started is the history.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CaptureDispatcher

      public CaptureDispatcher()
  • Method Details

    • pendingIds

      public List<Long> pendingIds(int limit)
      Ids of envelopes nothing has taken, oldest first.
    • dispatchAll

      public void dispatchAll(List<Long> ids)
      Dispatch every envelope in ids, each in its own transaction so one record's rollback cannot discard the others' work, all inside one re-entrancy guard context.
    • recoverExpired

      public int recoverExpired()
      Return safe abandoned work to the queue and retain ambiguous effects for reconciliation.
    • reconcile

      public boolean reconcile(Long id, boolean replay, String reason)
      An administrator has checked the external systems and decides whether the event may be replayed. The reason is kept even after a later successful dispatch.
    • sweep

      public int sweep()
      Delete dispatched envelopes past their retention; the run they started is the history. Failed ones are kept, since their reason is the only account of what went wrong.
      Returns:
      how many were removed