Class LimitGrantManager
java.lang.Object
com.tccc.kos.ext.dispense.pipeline.ingredient.grants.LimitGrantManager
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
acquireGrants
(PumpOp op) Acquire the specified grants for the specified pump op.void
releaseGrants
(PumpOp op) Called to release any grants acquired by the specified pump op.
-
Constructor Details
-
LimitGrantManager
public LimitGrantManager()
-
-
Method Details
-
acquireGrants
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 callingreleaseGrants()
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 toreleaseGrants()
. 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 interfacePumpOpGrantManager
- Parameters:
op
- the pump operation containing the grants- Returns:
- false if the grants could not be acquired
-
releaseGrants
Description copied from interface:PumpOpGrantManager
Called to release any grants acquired by the specified pump op.- Specified by:
releaseGrants
in interfacePumpOpGrantManager
- Parameters:
op
- the op used to acquire grants
-