Interface ManagedInvocationPolicy
- All Known Implementing Classes:
ManagedCallingPolicy, ManagedResiliencePolicy, ManagedResourcePolicy, ManagedSecurityPolicy
public interface ManagedInvocationPolicy
Trusted host-installed policy factory. Application annotations never install capabilities.
Implementations validate actual effective type/method metadata, not untrusted assertion strings.
The host invokes validate for every export before component construction, then prepares a bound
policy. Each bound policy is closed on failed activation or unexport; the factory is host-owned.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceOwned per-export policy state; cleanup must not retain application class loaders.static enumFixed outer-to-inner host ordering.static interfaceDirect generated dispatch continuation, callable according to the installed policy contract. -
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.default ManagedInvocationPolicy.BindingbindHosted(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> component, Set<org.j7m.middleware.application.api.ManagedMethod> callbacks) Binds one previously validated callback under the same finite hosted surface rule.default ManagedInvocationPolicy.Phasephase()Returns the fixed trusted host ordering phase.voidvalidate(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> implementation, Class<?> businessInterface) Validates a complete export contract without executing application code.default voidvalidateComponent(Class<?> component, boolean exported) Validates every finite component before any application constructor runs.default voidvalidateExposure(Class<?> component, Map<org.j7m.middleware.application.api.ManagedServiceContract, Class<?>> exports) Rejects claimed metadata that has no actual manifest-declared invocation boundary.default voidvalidateHosted(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> component, Set<org.j7m.middleware.application.api.ManagedMethod> callbacks) Validates one callback from a verified generated hosted allowlist.default voidvalidateHostedExposure(Class<?> component, Map<org.j7m.middleware.application.api.ManagedServiceContract, Class<?>> surfaces) Validates a component's combined exact wire-interface and concrete hosted callback surfaces.default voidvalidateHostedExposure(Class<?> component, Set<org.j7m.middleware.application.api.ManagedServiceContract> contracts) Validates exact generated local hosted boundaries without broadening the wire interface rule.
-
Method Details
-
phase
Returns the fixed trusted host ordering phase.- Returns:
- application phase by default for source compatibility
-
annotationTypes
Set<Class<? extends Annotation>> annotationTypes()Declares exactly which annotation behaviors this implementation enforces.- Returns:
- immutable finite capability set; an empty set permits a host-wide observer
-
validateComponent
Validates every finite component before any application constructor runs. The default rejects claimed policy metadata on non-exported components because ordinary Java calls have no invocation boundary. A real component adapter may override this to validate and enforce its supported metadata; annotation presence never installs that adapter.- Parameters:
component- declared component/product typeexported- whether this exact type is a manifest-declared exported implementation- Throws:
IllegalArgumentException- for unsupported non-entry policy metadata
-
validateExposure
default void validateExposure(Class<?> component, Map<org.j7m.middleware.application.api.ManagedServiceContract, Class<?>> exports) Rejects claimed metadata that has no actual manifest-declared invocation boundary. Runs for every finite component before binding policies or constructing application objects.- Parameters:
component- declared component/product typeexports- immutable actual full wire contracts mapped to their business interfaces- Throws:
IllegalArgumentException- for claimed metadata outside a supported exposure
-
validateHostedExposure
default void validateHostedExposure(Class<?> component, Set<org.j7m.middleware.application.api.ManagedServiceContract> contracts) Validates exact generated local hosted boundaries without broadening the wire interface rule. The host must obtain this finite allowlist from a verified generated definition. This setup entrypoint grants no application invocation or worker authority on its own.- Parameters:
component- concrete generated componentcontracts- finite complete hosted contract allowlist- Throws:
IllegalArgumentException- for unsupported or nonpublic callback metadata
-
validateHostedExposure
default void validateHostedExposure(Class<?> component, Map<org.j7m.middleware.application.api.ManagedServiceContract, Class<?>> surfaces) Validates a component's combined exact wire-interface and concrete hosted callback surfaces.- Parameters:
component- concrete generated componentsurfaces- verified contracts mapped to their actual interface or hosted component surface- Throws:
IllegalArgumentException- for unsupported or uncovered metadata
-
validateHosted
default void validateHosted(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> component, Set<org.j7m.middleware.application.api.ManagedMethod> callbacks) Validates one callback from a verified generated hosted allowlist.- Parameters:
contract- exact callback contractcomponent- generated concrete componentcallbacks- finite callback identities belonging to this definition- Throws:
IllegalArgumentException- for an undeclared callback or unsupported policy
-
bindHosted
default ManagedInvocationPolicy.Binding bindHosted(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> component, Set<org.j7m.middleware.application.api.ManagedMethod> callbacks) throws Exception Binds one previously validated callback under the same finite hosted surface rule.- Parameters:
contract- exact callback contractcomponent- generated concrete componentcallbacks- finite verified callback identities- Returns:
- owned policy binding
- Throws:
Exception- if the callback is undeclared or policy preparation fails
-
validate
void validate(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> implementation, Class<?> businessInterface) Validates a complete export contract without executing application code.- Parameters:
contract- verified contract ID/version and complete method signatureimplementation- concrete application implementationbusinessInterface- manifest-declared ordinary business interface- Throws:
IllegalArgumentException- for unsupported combinations
-
bind
ManagedInvocationPolicy.Binding bind(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> implementation, Class<?> businessInterface) throws Exception Prepares bounded per-export policy state after all contracts validate, before constructors.- Parameters:
contract- verified complete method identityimplementation- concrete application implementationbusinessInterface- manifest-declared business interface- Returns:
- owned policy state
- Throws:
Exception- when policy preparation fails
-