Class ManagedQueueConsumerFactory

java.lang.Object
org.j7m.middleware.application.distributed.ManagedQueueConsumerFactory
All Implemented Interfaces:
AutoCloseable, org.j7m.middleware.application.components.ManagedHostedResources.Factory, org.j7m.middleware.application.components.ManagedInvocationPolicy

public final class ManagedQueueConsumerFactory extends Object implements org.j7m.middleware.application.components.ManagedHostedResources.Factory, org.j7m.middleware.application.components.ManagedInvocationPolicy, AutoCloseable
Trusted reactive POJO consumer/DLQ lifecycle and its mandatory REPLAY policy. Install this same instance as both hosted factory and invocation policy. SECURITY runs before every claim/replay. Complete server-granted payloads consume bounded credit; no idle client claim polling occurs. Native ACK follows physical success; external UNKNOWN never automatically reenters the body. DLQ observers never ACK/remove/redrive retained poison records. Backends remain borrowed.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Actual lifecycle state, including physical drain rather than logical reply only.
    static enum 
    Safe fixed reason categories, without application exception or payload text.
    static final record 
    Bounded aggregate host diagnostics.

    Nested classes/interfaces inherited from interface org.j7m.middleware.application.components.ManagedInvocationPolicy

    org.j7m.middleware.application.components.ManagedInvocationPolicy.Binding, org.j7m.middleware.application.components.ManagedInvocationPolicy.Proceed
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a finite trusted worker host without opening sessions.
  • Method Summary

    Modifier and Type
    Method
    Description
    Set<Class<? extends Annotation>>
    Declares only the two queue callback capabilities this adapter implements.
    org.j7m.middleware.application.components.ManagedHostedResources.Binding
    bind(org.j7m.middleware.application.api.ManagedHostedFeature feature, org.j7m.middleware.application.api.ManagedComponentDefinition<?> definition, Object component, org.j7m.middleware.application.components.ManagedHostedResources.Bundle bundle, org.j7m.middleware.application.components.ManagedHostedResources.Invoker invoker)
    Creates a prepared lifecycle using only the actual trusted Invoker for application work.
    org.j7m.middleware.application.components.ManagedInvocationPolicy.Binding
    bind(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> implementation, Class<?> businessInterface)
    Binds the actual trusted per-invocation guard; no session is started by this method.
    void
    Closes shared host executors only after all actual application bindings were drained/released.
    org.j7m.middleware.application.components.ManagedInvocationPolicy.Phase
    Selects durable replay inside security and outside participating transactions.
    Set<org.j7m.middleware.application.components.ManagedInvocationPolicy>
    Requires actual installation of this exact host guard, not an application capability marker.
    status(String namespace, String handler)
    Reads safe local status without queue queries or message labels.
    status(String namespace, String tenant, String queue, String handler)
    Reads one exact tenant/queue-scoped logical handler status without network I/O.
    void
    validate(org.j7m.middleware.application.api.ManagedHostedFeature feature, org.j7m.middleware.application.api.ManagedComponentDefinition<?> definition, org.j7m.middleware.application.components.ManagedHostedResources.Bundle bundle)
    Validates a finite generated callback before constructors or native work.
    void
    validate(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> implementation, Class<?> businessInterface)
    Rejects queue markers outside an actual generated hosted callback.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.j7m.middleware.application.components.ManagedHostedResources.Factory

    backendKinds

    Methods inherited from interface org.j7m.middleware.application.components.ManagedInvocationPolicy

    bindHosted, validateComponent, validateExposure, validateHosted, validateHostedExposure, validateHostedExposure
  • Constructor Details

    • ManagedQueueConsumerFactory

      public ManagedQueueConsumerFactory(Map<String, QueueConsumerProfile> profiles, int maximumWorkers)
      Creates a finite trusted worker host without opening sessions.
      Parameters:
      profiles - at most64 named queue profiles
      maximumWorkers - simultaneous physical callbacks, 1..16
      Throws:
      IllegalArgumentException - for invalid registry/capacity
  • Method Details

    • requiredPolicies

      public Set<org.j7m.middleware.application.components.ManagedInvocationPolicy> requiredPolicies()
      Requires actual installation of this exact host guard, not an application capability marker.
      Specified by:
      requiredPolicies in interface org.j7m.middleware.application.components.ManagedHostedResources.Factory
      Returns:
      identity-bound mandatory invocation policy
    • phase

      public org.j7m.middleware.application.components.ManagedInvocationPolicy.Phase phase()
      Selects durable replay inside security and outside participating transactions.
      Specified by:
      phase in interface org.j7m.middleware.application.components.ManagedInvocationPolicy
      Returns:
      fixed REPLAY phase
    • annotationTypes

      public Set<Class<? extends Annotation>> annotationTypes()
      Declares only the two queue callback capabilities this adapter implements.
      Specified by:
      annotationTypes in interface org.j7m.middleware.application.components.ManagedHostedResources.Factory
      Specified by:
      annotationTypes in interface org.j7m.middleware.application.components.ManagedInvocationPolicy
      Returns:
      immutable exact marker set
    • validate

      public void validate(org.j7m.middleware.application.api.ManagedHostedFeature feature, org.j7m.middleware.application.api.ManagedComponentDefinition<?> definition, org.j7m.middleware.application.components.ManagedHostedResources.Bundle bundle)
      Validates a finite generated callback before constructors or native work.
      Specified by:
      validate in interface org.j7m.middleware.application.components.ManagedHostedResources.Factory
      Parameters:
      feature - exact hosted feature
      definition - generated component plan
      bundle - verified immutable bundle context
      Throws:
      IllegalArgumentException - for unsupported callback, queue, profile or descriptor mismatch
    • validate

      public void validate(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> implementation, Class<?> businessInterface)
      Rejects queue markers outside an actual generated hosted callback.
      Specified by:
      validate in interface org.j7m.middleware.application.components.ManagedInvocationPolicy
      Parameters:
      contract - complete method identity
      implementation - actual concrete component
      businessInterface - generated hosted class or ordinary business interface
      Throws:
      IllegalArgumentException - for exporting callback metadata as ordinary RPC
    • bind

      public org.j7m.middleware.application.components.ManagedInvocationPolicy.Binding bind(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> implementation, Class<?> businessInterface)
      Binds the actual trusted per-invocation guard; no session is started by this method.
      Specified by:
      bind in interface org.j7m.middleware.application.components.ManagedInvocationPolicy
      Parameters:
      contract - complete hosted or RPC identity
      implementation - concrete component
      businessInterface - verified business surface
      Returns:
      owned revocable replay guard
    • bind

      public org.j7m.middleware.application.components.ManagedHostedResources.Binding bind(org.j7m.middleware.application.api.ManagedHostedFeature feature, org.j7m.middleware.application.api.ManagedComponentDefinition<?> definition, Object component, org.j7m.middleware.application.components.ManagedHostedResources.Bundle bundle, org.j7m.middleware.application.components.ManagedHostedResources.Invoker invoker)
      Creates a prepared lifecycle using only the actual trusted Invoker for application work.
      Specified by:
      bind in interface org.j7m.middleware.application.components.ManagedHostedResources.Factory
      Parameters:
      feature - validated finite descriptor
      definition - generated component
      component - activation-owned instance, never closed by this factory
      bundle - verified immutable bundle
      invoker - actual host policy and physical completion boundary
      Returns:
      owned lifecycle; start/commitAdmission control external delivery
    • status

      public ManagedQueueConsumerFactory.Status status(String namespace, String handler)
      Reads safe local status without queue queries or message labels.
      Parameters:
      namespace - exact host logical namespace
      handler - stable feature identity
      Returns:
      immutable status
      Throws:
      IllegalArgumentException - if unbound
    • status

      public ManagedQueueConsumerFactory.Status status(String namespace, String tenant, String queue, String handler)
      Reads one exact tenant/queue-scoped logical handler status without network I/O.
      Parameters:
      namespace - host logical namespace
      tenant - exact source tenant
      queue - exact source queue
      handler - stable feature identity
      Returns:
      safe local status
      Throws:
      IllegalArgumentException - for an unknown or ambiguous kind binding
    • close

      public void close()
      Closes shared host executors only after all actual application bindings were drained/released.
      Specified by:
      close in interface AutoCloseable
      Throws:
      IllegalStateException - if any binding remains owned