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 Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Owned per-export policy state; cleanup must not retain application class loaders.
    static enum 
    Fixed outer-to-inner host ordering.
    static interface 
    Direct generated dispatch continuation, callable according to the installed policy contract.
  • Method Summary

    Modifier and Type
    Method
    Description
    Set<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.
    bindHosted(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.
    Returns the fixed trusted host ordering phase.
    void
    validate(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> implementation, Class<?> businessInterface)
    Validates a complete export contract without executing application code.
    default void
    validateComponent(Class<?> component, boolean exported)
    Validates every finite component before any application constructor runs.
    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.
    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.
    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.
    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.
  • 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

      default void validateComponent(Class<?> component, boolean exported)
      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 type
      exported - 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 type
      exports - 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 component
      contracts - 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 component
      surfaces - 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 contract
      component - generated concrete component
      callbacks - 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 contract
      component - generated concrete component
      callbacks - 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 signature
      implementation - concrete application implementation
      businessInterface - 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 identity
      implementation - concrete application implementation
      businessInterface - manifest-declared business interface
      Returns:
      owned policy state
      Throws:
      Exception - when policy preparation fails