Interface ManagedHostedResources.Binding
- All Superinterfaces:
AutoCloseable
- Enclosing class:
ManagedHostedResources
One owned backend lifecycle. Operations must be bounded and close must be idempotent.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Releases a fully drained or never-published resource; does not close the component.default voidCommits local admission after every backend has armed successfully.booleanCloses new admission and waits within the budget for actual apply/query/snapshot work.voidprepare()Prepares storage and endpoints with external effect admission closed.voidstart()Arms the prepared resource after application initialization/startup has completed.default voidAtomically closes new work admission without waiting or performing external I/O.
-
Method Details
-
stopAdmission
default void stopAdmission()Atomically closes new work admission without waiting or performing external I/O. Called under the host's activation admission guard before asynchronous resource draining. It must be thread-safe and idempotent, including after close. The default fails closed.- Throws:
UnsupportedOperationException- unless this backend implements actual admission control
-
prepare
-
start
Arms the prepared resource after application initialization/startup has completed. No external application work is admitted here. Actual admission requires both the later local commitAdmission() and the host's shared all-resources admission guard.- Throws:
Exception- if the resource cannot safely arm
-
commitAdmission
default void commitAdmission()Commits local admission after every backend has armed successfully. This must perform no external I/O or wait. A backend also honors the shared invoker admission guard, which remains closed until the host commits the entire activation.- Throws:
UnsupportedOperationException- unless atomic admission is implemented
-
drain
Closes new admission and waits within the budget for actual apply/query/snapshot work. A false result retains ownership and the classloader; it never authorizes forced cleanup.- Parameters:
budget- positive remaining drain budget- Returns:
- true only after actual resource work has exited
- Throws:
Exception- if safe draining cannot be established
-
close
Releases a fully drained or never-published resource; does not close the component.- Specified by:
closein interfaceAutoCloseable- Throws:
Exception- if durable/endpoint cleanup fails
-