Class ManagedResiliencePolicy
java.lang.Object
org.j7m.middleware.application.components.ManagedResiliencePolicy
- All Implemented Interfaces:
AutoCloseable, ManagedInvocationPolicy
public final class ManagedResiliencePolicy
extends Object
implements ManagedInvocationPolicy, AutoCloseable
Fixed tenant/dependency admission registry. Server bulkheads hold physical permits, while client
connection breakers are explicitly validated against the installed client registry. Rate tokens
are charged after authorization and before dependency admission, with no refund for later overload.
This implementation supports LOCAL rate coordination only and never silently degrades scope.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ManagedInvocationPolicy
ManagedInvocationPolicy.Binding, ManagedInvocationPolicy.Phase, ManagedInvocationPolicy.Proceed -
Constructor Summary
ConstructorsConstructorDescriptionManagedResiliencePolicy(Set<String> tenants, Function<org.j7m.middleware.application.api.InvocationContext, String> tenantResolver, Map<String, org.j7m.middleware.application.api.BulkheadProfile> bulkheads, Map<String, org.j7m.middleware.application.api.RateLimitProfile> rates, ManagedDependencyBreaker breaker) Creates finite server admission and optional client-breaker validation. -
Method Summary
Modifier and TypeMethodDescriptionSet<Class<? extends Annotation>> Declares exactly which annotation behaviors this implementation enforces.bind(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> implementation, Class<?> businessInterface) Prepares bounded per-export policy state after all contracts validate, before constructors.voidclose()Rejects new/queued calls; running physical permits remain owned until their completion.phase()Returns the fixed trusted host ordering phase.Returns actual dependency occupancy for one declared tenant, without dynamic state allocation.voidvalidate(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> implementation, Class<?> businessInterface) Validates a complete export contract without executing application code.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ManagedInvocationPolicy
bindHosted, validateComponent, validateExposure, validateHosted, validateHostedExposure, validateHostedExposure
-
Constructor Details
-
ManagedResiliencePolicy
public ManagedResiliencePolicy(Set<String> tenants, Function<org.j7m.middleware.application.api.InvocationContext, String> tenantResolver, Map<String, org.j7m.middleware.application.api.BulkheadProfile> bulkheads, Map<String, org.j7m.middleware.application.api.RateLimitProfile> rates, ManagedDependencyBreaker breaker) Creates finite server admission and optional client-breaker validation. The resolver receives the actual authenticated host context; application arguments never select a tenant.- Parameters:
tenants- at most64 predefined tenant identitiestenantResolver- trusted authenticated-context mapper; unknown results fail closedbulkheads- at most64 fixed dependency admission profilesrates- at most64 LOCAL fixed-window profilesbreaker- trusted matching client registry, or null to reject CircuitBreaker declarations
-
-
Method Details
-
phase
Returns the fixed trusted host ordering phase.- Specified by:
phasein interfaceManagedInvocationPolicy- Returns:
- application phase by default for source compatibility
-
annotationTypes
Declares exactly which annotation behaviors this implementation enforces.- Specified by:
annotationTypesin interfaceManagedInvocationPolicy- Returns:
- immutable finite capability set; an empty set permits a host-wide observer
-
validate
public void validate(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> implementation, Class<?> businessInterface) Validates a complete export contract without executing application code.- Specified by:
validatein interfaceManagedInvocationPolicy- Parameters:
contract- verified contract ID/version and complete method signatureimplementation- concrete application implementationbusinessInterface- manifest-declared ordinary business interface
-
bind
public ManagedInvocationPolicy.Binding bind(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> implementation, Class<?> businessInterface) Prepares bounded per-export policy state after all contracts validate, before constructors.- Specified by:
bindin interfaceManagedInvocationPolicy- Parameters:
contract- verified complete method identityimplementation- concrete application implementationbusinessInterface- manifest-declared business interface- Returns:
- owned policy state
-
status
Returns actual dependency occupancy for one declared tenant, without dynamic state allocation.- Parameters:
tenant- declared host tenantdependency- registered dependency name- Returns:
- immutable physical admission counters
-
close
public void close()Rejects new/queued calls; running physical permits remain owned until their completion.- Specified by:
closein interfaceAutoCloseable
-