LeaseCapability<H> class
abstract
A Capability backed by a HELD lease (ADR-0009 lease family). The author
implements the transport-specific hooks over an opaque handle H and NEVER a
Seed; the LeaseAllocation carrier owns the tree lifecycle. The engine
names no bus — a federation lease supplies H = (StationClient, LeaseGrant)
and wires the bus inside these hooks; a local single-station lease supplies a
local slot handle.
- Inheritance
-
- Object
- Capability
- LeaseCapability
Constructors
- LeaseCapability()
-
Const-constructible (capabilities are stateless description).
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
acquire(
TreeContext context, StepArgs args) → Future< LeaseResolution< H> > - Resolve + acquire a FRESH lease, returning its opaque handle (or a LeaseUnavailable when none can be bound — fail-closed). MUST poll StepArgs.cancel across its own async gaps; a dispose racing the acquire is unwound by the carrier (it calls release on the bound handle).
-
adoptable(
TreeContext context, StepArgs args) → Future< LeaseBound< H> ?> - A prior handle this node held, to attempt RE-ADOPTING instead of acquiring fresh (a detached daemon lease / crash survivor). Returns null → always acquire fresh (the offline P1 posture; the live arm wires it to the persisted handle). Only consulted for a daemon, and only reattached when proveFresh holds.
-
createAllocation(
AllocationContext ctx) → Allocation -
Mints the Allocation that holds this capability's live effect — the
createRenderObjectanalogue (ADR-0009 D4). Synchronous + cheap; the Host then drives it asynchronously (startOrAdopt/update/dispose/detach). ProcessCapability/ServiceCapability supply defaults, so an existing capability needs no change; an asset overrides only to customize adopt/ detach/update for a bespoke effect.override -
dispatchOn(
H handle, TreeContext context, StepArgs args) → Future< StepOutcome> -
Dispatch the work on the leased slot
handleand interpret the result into a StepOutcome — Ok (with the payload a daemon publishes onready/ a job records oncomplete) or Failed. A lease dispatch does NOT route (M5 D-4a): routing is a RouteCapability's RouteVerdict, never an ordinary body's outcome. Called once after a successful acquire; NOT called on adopt. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
proveFresh(
H handle, TreeContext context, StepArgs args) → Future< bool> -
No-adopt-on-faith freshness proof (D4/D5): confirm
handleis still a live lease we hold (the owner-side check — e.g. a fenced heartbeat). Only consulted for a daemon with an adoptable prior handle. Defaults tofalse(never adopt blind); a real daemon lease overrides it. MUST be idempotent / side-effect-free beyond the liveness check. -
release(
H handle) → Future< void> -
Release
handle, freeing the leased slot. MUST be idempotent and must not throw for an already-reaped/invalid lease (the carrier calls it on dispose + on a cancel-race, possibly more than once across incarnations). -
supervisionPolicy(
StepArgs args) → SupervisionPolicy -
This capability's per-kind supervision declaration.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited