Class ManagedOutboxFactory
java.lang.Object
org.j7m.middleware.application.distributed.ManagedOutboxFactory
- All Implemented Interfaces:
AutoCloseable, org.j7m.middleware.application.components.ManagedHostBindings.Factory, org.j7m.middleware.application.components.ManagedHostedResources.Factory
public final class ManagedOutboxFactory
extends Object
implements org.j7m.middleware.application.components.ManagedHostBindings.Factory, org.j7m.middleware.application.components.ManagedHostedResources.Factory, AutoCloseable
Ordinary-interface outbox producers plus automatically generated methodless relay lifecycles.
Producer writes share the actual A11 guarded Connection; no queue send occurs in that transaction.
One bounded host relay per logical SQL namespace survives individual binding departure. It uses
stable native publication IDs, so a crash between send and SQL mark never creates a new message.
Connections opened by relays are owned, while factories, codecs, queues and telemetry are borrowed.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordFinite ordinary producer capability.static final recordSafe aggregate relay status, without SQL values, payload or exception messages. -
Constructor Summary
ConstructorsConstructorDescriptionManagedOutboxFactory(Map<String, ManagedOutboxFactory.Registration> resources, int maximumWorkers) Builds finite explicit producer/relay registrations, rejecting conflicting shared SQL scopes. -
Method Summary
Modifier and TypeMethodDescriptionSet<Class<? extends Annotation>> Declares only the actual outbox annotation capability.Declares only the methodless backend kind implemented here; it grants no generic callback bypass.org.j7m.middleware.application.components.ManagedHostBindings.BoundValuebind(org.j7m.middleware.application.api.ManagedDependency dependency) Creates a revocable ordinary producer; actual enqueue requires this caller's owned JDBC scope.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) Joins one shared logical relay through an independently owned activation lease.voidclose()Releases host executors only after every owned lease has actually drained.Reads local safe counters without SQL or queue I/O.voidvalidate(org.j7m.middleware.application.api.ManagedDependency dependency, org.j7m.middleware.annotations.Scope.Kind scope) Validates provider-only source binding without opening SQL or queue connections.voidvalidate(org.j7m.middleware.application.api.ManagedHostedFeature feature, org.j7m.middleware.application.api.ManagedComponentDefinition<?> definition, org.j7m.middleware.application.components.ManagedHostedResources.Bundle bundle) Validates an actual methodless generated dependency feature before constructors.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
requiredPolicies
-
Constructor Details
-
ManagedOutboxFactory
public ManagedOutboxFactory(Map<String, ManagedOutboxFactory.Registration> resources, int maximumWorkers) Builds finite explicit producer/relay registrations, rejecting conflicting shared SQL scopes.- Parameters:
resources- named resource capabilities, at most256, at most64 distinct SQL namespacesmaximumWorkers- physical relay workers1..16- Throws:
IllegalArgumentException- for invalid methods, profiles or conflicting shared capabilities
-
-
Method Details
-
annotationTypes
Declares only the actual outbox annotation capability.- Specified by:
annotationTypesin interfaceorg.j7m.middleware.application.components.ManagedHostedResources.Factory- Returns:
- exact immutable marker set
-
backendKinds
-
validate
public void validate(org.j7m.middleware.application.api.ManagedDependency dependency, org.j7m.middleware.annotations.Scope.Kind scope) Validates provider-only source binding without opening SQL or queue connections.- Specified by:
validatein interfaceorg.j7m.middleware.application.components.ManagedHostBindings.Factory- Parameters:
dependency- generated exact resource edgescope- component capture scope- Throws:
IllegalArgumentException- for an unknown resource, direct capture or unsupported refresh
-
bind
public org.j7m.middleware.application.components.ManagedHostBindings.BoundValue bind(org.j7m.middleware.application.api.ManagedDependency dependency) Creates a revocable ordinary producer; actual enqueue requires this caller's owned JDBC scope.- Specified by:
bindin interfaceorg.j7m.middleware.application.components.ManagedHostBindings.Factory- Parameters:
dependency- validated producer dependency- Returns:
- owned local binding, never owner of the borrowed backend registrations
-
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 an actual methodless generated dependency feature before constructors.- Specified by:
validatein interfaceorg.j7m.middleware.application.components.ManagedHostedResources.Factory- Parameters:
feature- exact finite relay descriptordefinition- owning component definition, including selected dependency sitesbundle- verified immutable bundle context- Throws:
IllegalArgumentException- for forged callbacks, resource, profile or duplicate SQL configuration
-
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) Joins one shared logical relay through an independently owned activation lease.- Specified by:
bindin interfaceorg.j7m.middleware.application.components.ManagedHostedResources.Factory- Parameters:
feature- validated methodless descriptordefinition- generated dependency ownercomponent- unused and possibly null for a methodless backend; never constructed herebundle- verified immutable bundleinvoker- actual admission guard; no application callback is invoked by the relay- Returns:
- owned independent lease whose departure cannot stop another active owner
-
status
Reads local safe counters without SQL or queue I/O.- Parameters:
resource- exact host resource namepolicy- exact publication profile name- Returns:
- local relay counters, zero when not currently bound
- Throws:
IllegalArgumentException- for an unknown resource/profile
-
close
public void close()Releases host executors only after every owned lease has actually drained.- Specified by:
closein interfaceAutoCloseable- Throws:
IllegalStateException- while a relay lease or physical operation remains
-