Class LiveServiceBindings
java.lang.Object
org.j7m.middleware.application.components.LiveServiceBindings
- All Implemented Interfaces:
AutoCloseable
Trusted-host owner of at most256 live service bindings. Candidate authorization/readiness is
mandatory and never inferred solely from metadata. Two bounded daemon workers coalesce callback
snapshots; discovery ownership remains with the supplied source. This is target selection, not
an invocation retry, transaction, credential carrier or durable deduplication service.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordSafe aggregate lifecycle information. -
Constructor Summary
ConstructorsConstructorDescriptionLiveServiceBindings(org.j7m.middleware.application.api.BindingCandidateSource source, org.j7m.middleware.application.api.BindingConnector connector, org.j7m.middleware.application.api.BindingAdmission admission, String localRuntime, Map<String, org.j7m.middleware.application.api.BindingPolicy> policies, Supplier<Instant> callerDeadline) Creates a trusted host owner; no allow-all admission or implicit deadline is supplied.LiveServiceBindings(org.j7m.middleware.application.api.BindingCandidateSource source, org.j7m.middleware.application.api.BindingConnector connector, org.j7m.middleware.application.api.BindingAdmission admission, String localRuntime, Map<String, org.j7m.middleware.application.api.BindingPolicy> policies, Supplier<Instant> callerDeadline, org.j7m.middleware.application.api.ClientCallInterceptor interceptor) Creates a binding owner with an explicit trusted dependency-call interceptor. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes handles and revokes queued observers without closing borrowed source/runtime.<T> org.j7m.middleware.application.api.ServiceBinding<T> Opens a finite live handle.org.j7m.middleware.application.api.BindingPolicyReturns an immutable host policy for adapter prevalidation without discovery or application work.status()Returns aggregate counters without candidate, credential or qualifier labels.
-
Constructor Details
-
LiveServiceBindings
public LiveServiceBindings(org.j7m.middleware.application.api.BindingCandidateSource source, org.j7m.middleware.application.api.BindingConnector connector, org.j7m.middleware.application.api.BindingAdmission admission, String localRuntime, Map<String, org.j7m.middleware.application.api.BindingPolicy> policies, Supplier<Instant> callerDeadline) Creates a trusted host owner; no allow-all admission or implicit deadline is supplied.- Parameters:
source- borrowed bounded candidate sourceconnector- borrowed exact-reference connector without HA retryadmission- trusted bounded authorization/readiness check, thread-safe and no principal mutationlocalRuntime- local runtime identity for PREFER_LOCALpolicies- immutable named policies, at most256; names are safe identifierscallerDeadline- current caller absolute deadline; also capped by policy budget- Throws:
IllegalArgumentException- for malformed policy names/capacity
-
LiveServiceBindings
public LiveServiceBindings(org.j7m.middleware.application.api.BindingCandidateSource source, org.j7m.middleware.application.api.BindingConnector connector, org.j7m.middleware.application.api.BindingAdmission admission, String localRuntime, Map<String, org.j7m.middleware.application.api.BindingPolicy> policies, Supplier<Instant> callerDeadline, org.j7m.middleware.application.api.ClientCallInterceptor interceptor) Creates a binding owner with an explicit trusted dependency-call interceptor. The default constructor retains one attempt; annotations never install this interceptor.- Parameters:
source- borrowed candidate sourceconnector- borrowed exact-reference read-only connectoradmission- trusted authorization/readiness callbacklocalRuntime- local runtime identitypolicies- finite named binding policiescallerDeadline- current caller deadline, also bounded by binding policyinterceptor- trusted host policy; must preserve pinned identity and physical-call safety- Throws:
IllegalArgumentException- for invalid policy names/capacity
-
-
Method Details
-
policy
Returns an immutable host policy for adapter prevalidation without discovery or application work.- Parameters:
name- registered policy ID- Returns:
- immutable policy
- Throws:
IllegalArgumentException- if the policy is unknown
-
open
public <T> org.j7m.middleware.application.api.ServiceBinding<T> open(org.j7m.middleware.application.api.ServiceBindingRequest<T> request, String policyName) Opens a finite live handle. Required policies establish an initial target within budget. OPTIONAL policies allow initial absence and must be consumed through optionalProvider().- Type Parameters:
T- ordinary business contract- Parameters:
request- exact contract/version/qualifier requestpolicyName- host policy ID- Returns:
- owned live handle
- Throws:
org.j7m.middleware.api.MiddlewareException- for unavailable targets or exhausted capacityIllegalArgumentException- for unknown policies
-
status
Returns aggregate counters without candidate, credential or qualifier labels.- Returns:
- bounded owner status
-
close
public void close()Closes handles and revokes queued observers without closing borrowed source/runtime. In-flight calls keep their captured target and are neither replayed nor claimed undone.- Specified by:
closein interfaceAutoCloseable
-