Class LimitGrantManager

java.lang.Object
com.tccc.kos.ext.dispense.pipeline.ingredient.grants.LimitGrantManager
All Implemented Interfaces:
PumpOpGrantManager

public class LimitGrantManager extends Object implements PumpOpGrantManager
Grant manager that operates on the limit grant that limits the number of operations that can be performed concurrently based on the boards the pumps are attached to.
Since:
1.0
Version:
2024-07-24
  • Constructor Details

    • LimitGrantManager

      public LimitGrantManager()
  • Method Details

    • acquireGrants

      public boolean acquireGrants(PumpOp op)
      Description copied from interface: PumpOpGrantManager
      Acquire the specified grants for the specified pump op. If the grants can be acquired, any associated resources should be locked until released by calling releaseGrants() with the same pump op. Each registered manager will be called and if any one fails, all acquired grants up to that point will be released by a call to releaseGrants() . All calls are serialized so grant managers need not worry about concurrency or global deadlocks. If this manager does not manage any of the specified grants, it should still return true to indicate that no grants have been denied.
      Specified by:
      acquireGrants in interface PumpOpGrantManager
      Parameters:
      op - the pump operation containing the grants
      Returns:
      false if the grants could not be acquired
    • releaseGrants

      public void releaseGrants(PumpOp op)
      Description copied from interface: PumpOpGrantManager
      Called to release any grants acquired by the specified pump op.
      Specified by:
      releaseGrants in interface PumpOpGrantManager
      Parameters:
      op - the op used to acquire grants