Class ManagedSagaFactory
java.lang.Object
org.j7m.middleware.application.distributed.ManagedSagaFactory
- All Implemented Interfaces:
AutoCloseable, org.j7m.middleware.application.components.ManagedHostedResources.Factory, org.j7m.middleware.application.components.ManagedInvocationPolicy
public final class ManagedSagaFactory
extends Object
implements org.j7m.middleware.application.components.ManagedHostedResources.Factory, org.j7m.middleware.application.components.ManagedInvocationPolicy, AutoCloseable
General bounded POJO saga host and mandatory replay-phase policy. Native intents precede handlers;
result encoding and completion run in owned finalization after actual USER work. No callback runs
on timers or consensus threads. The same instance must be installed as factory and required policy.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordSafe host lifecycle observation; failureCategory contains only an exception class name.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.Phase, org.j7m.middleware.application.components.ManagedInvocationPolicy.Proceed -
Constructor Summary
ConstructorsConstructorDescriptionManagedSagaFactory(Map<String, ManagedSagaProfile> profiles, int concurrency, int pending) Creates finite host executors with middleware TCCL and no inherited application locals. -
Method Summary
Modifier and TypeMethodDescriptionadministrativeClient(String policy, String definition, int version) Explicitly grants a separate host-selected administrative client view.Set<Class<? extends Annotation>> Returns the supported managed saga annotation contract.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) Binds one activation without starting work before global admission commit.org.j7m.middleware.application.components.ManagedInvocationPolicy.Bindingbind(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> implementation, Class<?> businessInterface) Installs only trusted attempt context and owned result finalization; a raw Java call cannot acquire it.Creates a resource-injectable facade for a host-selected definition and version.voidclose()Closes only after every activation has actually drained and released its binding.org.j7m.middleware.application.components.ManagedInvocationPolicy.Phasephase()Places durable result recording outside participating transaction finalization.Set<org.j7m.middleware.application.components.ManagedInvocationPolicy> Requires the exact host policy instance, not a matching annotation token from another object.Returns bounded lifecycle evidence without payloads or exception messages.voidvalidate(org.j7m.middleware.application.api.ManagedHostedFeature feature, org.j7m.middleware.application.api.ManagedComponentDefinition<?> definition, org.j7m.middleware.application.components.ManagedHostedResources.Bundle bundle) Validates complete finite callback and schema metadata before constructors.voidvalidate(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> implementation, Class<?> businessInterface) Validates policy attachment to a generated saga callback, never an ordinary RPC alias.voidvalidateComponent(Class<?> component, boolean exported) Rejects saga callback metadata without a concrete hosted definition.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
backendKindsMethods inherited from interface org.j7m.middleware.application.components.ManagedInvocationPolicy
bindHosted, validateExposure, validateHosted, validateHostedExposure, validateHostedExposure
-
Constructor Details
-
ManagedSagaFactory
Creates finite host executors with middleware TCCL and no inherited application locals.- Parameters:
profiles- at most64 trusted named profilesconcurrency- worker count, 1..8pending- bounded worker backlog, 1..64- Throws:
IllegalArgumentException- for invalid names or capacities
-
-
Method Details
-
annotationTypes
Returns the supported managed saga annotation contract.- Specified by:
annotationTypesin interfaceorg.j7m.middleware.application.components.ManagedHostedResources.Factory- Specified by:
annotationTypesin interfaceorg.j7m.middleware.application.components.ManagedInvocationPolicy- Returns:
- exact immutable marker set
-
requiredPolicies
Requires the exact host policy instance, not a matching annotation token from another object.- Specified by:
requiredPoliciesin interfaceorg.j7m.middleware.application.components.ManagedHostedResources.Factory- Returns:
- required policy identity
-
phase
public org.j7m.middleware.application.components.ManagedInvocationPolicy.Phase phase()Places durable result recording outside participating transaction finalization.- Specified by:
phasein interfaceorg.j7m.middleware.application.components.ManagedInvocationPolicy- Returns:
- replay phase
-
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 complete finite callback and schema metadata before constructors.- Specified by:
validatein interfaceorg.j7m.middleware.application.components.ManagedHostedResources.Factory- Parameters:
feature- generated featuredefinition- actual generated adapterbundle- verified program identity- Throws:
IllegalArgumentException- for unsupported shapes, profiles or forged descriptors
-
validateComponent
Rejects saga callback metadata without a concrete hosted definition.- Specified by:
validateComponentin interfaceorg.j7m.middleware.application.components.ManagedInvocationPolicy- Parameters:
component- actual component classexported- whether it is a hosted/exported entry- Throws:
IllegalArgumentException- for unhosted saga metadata
-
validate
public void validate(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> implementation, Class<?> businessInterface) Validates policy attachment to a generated saga callback, never an ordinary RPC alias.- Specified by:
validatein interfaceorg.j7m.middleware.application.components.ManagedInvocationPolicy- Parameters:
contract- actual hosted identityimplementation- concrete POJObusinessInterface- generated callback declaration type- Throws:
IllegalArgumentException- for missing profile or invalid exposure
-
bind
public org.j7m.middleware.application.components.ManagedInvocationPolicy.Binding bind(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> implementation, Class<?> businessInterface) Installs only trusted attempt context and owned result finalization; a raw Java call cannot acquire it.- Specified by:
bindin interfaceorg.j7m.middleware.application.components.ManagedInvocationPolicy- Parameters:
contract- validated hosted callbackimplementation- actual POJObusinessInterface- actual callback type- Returns:
- per-export borrowed policy binding
-
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) Binds one activation without starting work before global admission commit.- Specified by:
bindin interfaceorg.j7m.middleware.application.components.ManagedHostedResources.Factory- Parameters:
feature- verified featuredefinition- actual adaptercomponent- actual constructed POJObundle- verified identityinvoker- trusted fixed-authority owned callback handle- Returns:
- owned lifecycle binding
- Throws:
IllegalArgumentException- for invalid component or conflicting live definitionIllegalStateException- for a closed/full factory
-
client
Creates a resource-injectable facade for a host-selected definition and version. The facade resolves only a currently admitted matching binding; it never chooses an endpoint from application input and cannot continue a different persisted artifact.- Parameters:
policy- exact host-selected backend profiledefinition- host-registered definition nameversion- positive definition version- Returns:
- facade that remains unavailable until actual activation admission
- Throws:
IllegalArgumentException- for invalid identity
-
administrativeClient
Explicitly grants a separate host-selected administrative client view. The ordinary client never inherits the backend capability configured for internal reconciliation. Applications receive this view only through an explicit host registration; annotations and client metadata cannot turn an ordinary view into this capability.- Parameters:
policy- exact host-selected backend profiledefinition- trusted definition nameversion- positive definition version- Returns:
- administrative view still requiring the profile's real server authorization
- Throws:
IllegalArgumentException- for invalid identity
-
status
Returns bounded lifecycle evidence without payloads or exception messages.- Parameters:
definition- exact hosted definitionversion- definition version- Returns:
- first matching local binding's actual status
- Throws:
IllegalArgumentException- if no binding exists
-
close
public void close()Closes only after every activation has actually drained and released its binding.- Specified by:
closein interfaceAutoCloseable- Throws:
IllegalStateException- while a binding still owns application work
-