Class ManagedEventSubscriptionFactory

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

public final class ManagedEventSubscriptionFactory extends Object implements org.j7m.middleware.application.components.ManagedHostedResources.Factory, AutoCloseable
General lifecycle adapter for generated durable subscription handlers. It borrows authorized endpoints and uses only the trusted hosted invoker for application work. One serial page per binding and a shared bounded worker pool prevent an unbounded delivery backlog. Delivery is at least once; no native exclusive claim or transaction with arbitrary application effects is claimed.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Safe lifecycle state, containing no application payload or exception text.
    static enum 
    Safe fixed failure categories; unavailable source is retryable without resetting progress.
    static final record 
    Immutable status for trusted host diagnostics.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ManagedEventSubscriptionFactory(Map<String, EventSubscriptionProfile> profiles, int maximumWorkers, int maximumQueued)
    Creates an explicit bounded host adapter.
  • Method Summary

    Modifier and Type
    Method
    Description
    Set<Class<? extends Annotation>>
    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)
    void
    Closes idle host executors after every application binding has actually drained and closed.
    status(String sourceNamespace, String id)
    Returns a redacted immutable snapshot for a currently bound identity.
    void
    validate(org.j7m.middleware.application.api.ManagedHostedFeature feature, org.j7m.middleware.application.api.ManagedComponentDefinition<?> definition, org.j7m.middleware.application.components.ManagedHostedResources.Bundle bundle)

    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, requiredPolicies
  • Constructor Details

    • ManagedEventSubscriptionFactory

      public ManagedEventSubscriptionFactory(Map<String, EventSubscriptionProfile> profiles, int maximumWorkers, int maximumQueued)
      Creates an explicit bounded host adapter. Endpoints remain borrowed.
      Parameters:
      profiles - at most64 named immutable source policies
      maximumWorkers - fixed worker count in1..16
      maximumQueued - bounded shared ready queue in1..64
      Throws:
      IllegalArgumentException - for invalid profiles or capacities
      NullPointerException - for null profile members
  • Method Details

    • annotationTypes

      public Set<Class<? extends Annotation>> annotationTypes()
      Specified by:
      annotationTypes in interface org.j7m.middleware.application.components.ManagedHostedResources.Factory
    • 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)
      Specified by:
      validate in interface org.j7m.middleware.application.components.ManagedHostedResources.Factory
    • 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)
      Specified by:
      bind in interface org.j7m.middleware.application.components.ManagedHostedResources.Factory
    • status

      public ManagedEventSubscriptionFactory.Status status(String sourceNamespace, String id)
      Returns a redacted immutable snapshot for a currently bound identity.
      Parameters:
      sourceNamespace - exact host source namespace
      id - stable subscription identity
      Returns:
      current status
      Throws:
      IllegalArgumentException - if the identity is not bound
    • close

      public void close()
      Closes idle host executors after every application binding has actually drained and closed.
      Specified by:
      close in interface AutoCloseable
      Throws:
      IllegalStateException - while an activation still owns a binding