Class PumpOpGrantService

java.lang.Object
com.tccc.kos.ext.dispense.pipeline.ingredient.grants.PumpOpGrantService

public class PumpOpGrantService extends Object
Service that aggregates PumpOpGrantManager instances. This is called at the start of every PumpOp if it contains any grants. This service will try to acquire the required grants from the managers. If all grants are acquired, the pump op will be performed, otherwise it will be held until grants are released by another pump op or the intent that the pump op is part of is cancelled.

Every IngredientNozzlePipeline contains an instance of this service along with an instance of LimitPumpOpGrantManager and LockPumpOpGrantManager. Since pipelines are specific to a nozzle, this means that in a multi-nozzle environment, each nozzle manages grants independently which normally makes sense. In cases where resources are shared between nozzles, a new instance can be created and installed into multiple pipelines. This effectively makes grants global.

Since:
1.0
Version:
2024-07-24
  • Constructor Details

    • PumpOpGrantService

      public PumpOpGrantService()
  • Method Details

    • add

      public void add(PumpOpGrantManager mgr)
      Add a new manager to the service.
    • acquireGrants

      public void acquireGrants(PumpOp op)
      Acquire the specified grants for the specified pump op.
      Parameters:
      op - the pump operation the grants are for
    • releaseGrants

      public void releaseGrants(PumpOp op)
      Called to release any grants acquired by the specified pump op.
      Parameters:
      op - the op used to acquire grants