Class AbstractProcessOutboxCommand
java.lang.Object
org.chenile.orchestrator.process.service.outbox.AbstractProcessOutboxCommand
- All Implemented Interfaces:
OutboxCommandLifecycle<ProcessTransition>
- Direct Known Subclasses:
CreateSubProcessCommand, EmitCompletedCommand, SignalParentCommand, StartWorkerCommand
public abstract class AbstractProcessOutboxCommand
extends Object
implements OutboxCommandLifecycle<ProcessTransition>
Shared tenant isolation and JSON persistence, not a central command switch.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate EntityManagerprotected final TransactionTemplateprotected final ObjectMapperprivate final ProcessOutboxRepository -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractProcessOutboxCommand(ProcessOutboxRepository outbox, ObjectMapper mapper, PlatformTransactionManager transactionManager) -
Method Summary
Modifier and TypeMethodDescriptionprotected final booleancheckIdempotency(String consumer, String key) True permits execution and records the claim in the current transaction.protected voiddeadCommand(OutboxCommand entry) final voiddispatch(OutboxCommand entry) protected abstract voiddispatchCommand(OutboxCommand entry) private voidFlush tenant-derived JPA callbacks before returning to the caller's context.private voidinTenantContext(String tenantId, AbstractProcessOutboxCommand.ThrowingRunnable body) Install the command tenant, run the body, and always restore the caller's context.final voidonDead(OutboxCommand entry) protected <T> Tread(OutboxCommand entry, Class<T> type) protected voidprotected booleanterminal(ProcessTransition transition) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface OutboxCommandLifecycle
enqueue, executionHeaders, shouldEnqueue, type
-
Field Details
-
outbox
-
mapper
-
independent
-
entityManager
-
-
Constructor Details
-
AbstractProcessOutboxCommand
protected AbstractProcessOutboxCommand(ProcessOutboxRepository outbox, ObjectMapper mapper, PlatformTransactionManager transactionManager)
-
-
Method Details
-
store
-
read
- Throws:
Exception
-
checkIdempotency
-
flushTenantScopedChanges
private void flushTenantScopedChanges()Flush tenant-derived JPA callbacks before returning to the caller's context. -
terminal
-
dispatch
- Specified by:
dispatchin interfaceOutboxCommandLifecycle<ProcessTransition>- Throws:
Exception
-
onDead
- Specified by:
onDeadin interfaceOutboxCommandLifecycle<ProcessTransition>- Throws:
Exception
-
inTenantContext
private void inTenantContext(String tenantId, AbstractProcessOutboxCommand.ThrowingRunnable body) throws Exception Install the command tenant, run the body, and always restore the caller's context.- Throws:
Exception
-
dispatchCommand
- Throws:
Exception
-
deadCommand
- Throws:
Exception
-
CHENILE