Class ManagedDependencyBreaker
java.lang.Object
org.j7m.middleware.application.components.ManagedDependencyBreaker
- All Implemented Interfaces:
AutoCloseable, org.j7m.middleware.application.api.ClientCallInterceptor
public final class ManagedDependencyBreaker
extends Object
implements org.j7m.middleware.application.api.ClientCallInterceptor, AutoCloseable
Host-owned tenant dependency registry surviving target refresh. Only connect/OPEN failures count.
The breaker wraps the optional retry delegate, counting at most one failed logical call. OPEN
rejection never enters retry. HALF_OPEN uses bounded readonly probes, never business health calls.
Instances own no worker threads; each tenant must receive its own explicitly scoped registry.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumObservable host state; these states do not claim whether a remote business effect completed.static final recordImmutable host diagnostic snapshot, with no application arguments or principal data. -
Constructor Summary
ConstructorsConstructorDescriptionManagedDependencyBreaker(String tenantNamespace, Map<String, org.j7m.middleware.application.api.CircuitBreakerProfile> profiles) Creates an isolated tenant registry with one attempt per logical call.ManagedDependencyBreaker(String tenantNamespace, Map<String, org.j7m.middleware.application.api.CircuitBreakerProfile> profiles, org.j7m.middleware.application.api.ClientCallInterceptor delegate) Creates a breaker outside the given retry/dependency delegate. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Rejects new calls; existing readonly probes retain their accounting until actual exit.invoke(org.j7m.middleware.application.api.ClientCall call, org.j7m.middleware.application.api.ClientAttempt attempt) Returns a bounded dependency diagnostic without creating state for unknown names.void
-
Constructor Details
-
ManagedDependencyBreaker
public ManagedDependencyBreaker(String tenantNamespace, Map<String, org.j7m.middleware.application.api.CircuitBreakerProfile> profiles) Creates an isolated tenant registry with one attempt per logical call.- Parameters:
tenantNamespace- explicit trusted tenant namespace, never inferred from application argumentsprofiles- at most64 fixed dependency policy names
-
ManagedDependencyBreaker
public ManagedDependencyBreaker(String tenantNamespace, Map<String, org.j7m.middleware.application.api.CircuitBreakerProfile> profiles, org.j7m.middleware.application.api.ClientCallInterceptor delegate) Creates a breaker outside the given retry/dependency delegate.- Parameters:
tenantNamespace- explicit trusted tenant scope; separate instances isolate tenantsprofiles- finite immutable host registrydelegate- inner interceptor, normally ManagedClientRetry; never called while OPEN
-
-
Method Details
-
validate
- Specified by:
validatein interfaceorg.j7m.middleware.application.api.ClientCallInterceptor
-
invoke
-
status
Returns a bounded dependency diagnostic without creating state for unknown names.- Parameters:
policy- registered name- Returns:
- immutable state
-
close
public void close()Rejects new calls; existing readonly probes retain their accounting until actual exit.- Specified by:
closein interfaceAutoCloseable
-