Class PumpOpGrantService
java.lang.Object
com.tccc.kos.ext.dispense.pipeline.ingredient.grants.PumpOpGrantService
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
acquireGrants
(PumpOp op) Acquire the specified grants for the specified pump op.void
add
(PumpOpGrantManager mgr) Add a new manager to the service.void
releaseGrants
(PumpOp op) Called to release any grants acquired by the specified pump op.
-
Constructor Details
-
PumpOpGrantService
public PumpOpGrantService()
-
-
Method Details
-
add
Add a new manager to the service. -
acquireGrants
Acquire the specified grants for the specified pump op.- Parameters:
op
- the pump operation the grants are for
-
releaseGrants
Called to release any grants acquired by the specified pump op.- Parameters:
op
- the op used to acquire grants
-