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 ClassesModifier and TypeClassDescriptionstatic enumSafe lifecycle state, containing no application payload or exception text.static enumSafe fixed failure categories; unavailable source is retryable without resetting progress.static final recordImmutable status for trusted host diagnostics. -
Constructor Summary
ConstructorsConstructorDescriptionManagedEventSubscriptionFactory(Map<String, EventSubscriptionProfile> profiles, int maximumWorkers, int maximumQueued) Creates an explicit bounded host adapter. -
Method Summary
Modifier and TypeMethodDescriptionSet<Class<? extends Annotation>> org.j7m.middleware.application.components.ManagedHostedResources.Bindingbind(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) voidclose()Closes idle host executors after every application binding has actually drained and closed.Returns a redacted immutable snapshot for a currently bound identity.voidvalidate(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, waitMethods 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 policiesmaximumWorkers- fixed worker count in1..16maximumQueued- bounded shared ready queue in1..64- Throws:
IllegalArgumentException- for invalid profiles or capacitiesNullPointerException- for null profile members
-
-
Method Details
-
annotationTypes
- Specified by:
annotationTypesin interfaceorg.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:
validatein interfaceorg.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:
bindin interfaceorg.j7m.middleware.application.components.ManagedHostedResources.Factory
-
status
Returns a redacted immutable snapshot for a currently bound identity.- Parameters:
sourceNamespace- exact host source namespaceid- 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:
closein interfaceAutoCloseable- Throws:
IllegalStateException- while an activation still owns a binding
-