Package io.mats3.impl.jms
Class JmsMatsTransactionManager_Jms
java.lang.Object
io.mats3.impl.jms.JmsMatsTransactionManager_Jms
- All Implemented Interfaces:
JmsMatsStatics
,JmsMatsTransactionManager
- Direct Known Subclasses:
JmsMatsTransactionManager_JmsAndJdbc
,JmsMatsTransactionManager_JmsAndSpringManagedSqlTx
public class JmsMatsTransactionManager_Jms
extends Object
implements JmsMatsTransactionManager, JmsMatsStatics
Implementation of
JmsMatsTransactionManager
handling only JMS (getting Connections, and creating Sessions),
doing all transactional handling "native", i.e. using only the JMS API (as opposed to e.g. using Spring and its
transaction managers).
The JMS Connection and Session handling is performed in calling code, where the resulting JmsMatsJmsSessionHandler.JmsSessionHolder
is
provided to the JmsMatsTransactionManager_Jms.TransactionalContext_Jms.doTransaction(JmsMatsInternalExecutionContext, ProcessingLambda)
.
Note: Musing about the JmsMats transactional handling 6 years later (2021-02-03), I do find it a tad bit obscure.
This entire Mats implementation is a JMS implementation, and all JMS Session handling is handled by the "core", but
just exactly commit and rollback is handled in this class. The extensions handling SQL are much more "independent" as
such. However, the big point is the JmsMatsStageProcessor
, which has a JMS Consumer-pump/loop, and that
Consumer's JMS Session is intimately intertwined with the transaction aspects handled here. Had it only been the
JmsMatsInitiator
and as such initiations of messages that should be handled, much more of the JMS transaction
management could have been handled here. (Actually, the only transactional aspect at that point would have been to
put a transaction around the actual sending, so that if more than one message was sent, they were all either sent or
not.)-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
TheJmsMatsTransactionManager.TransactionContext
implementation forJmsMatsTransactionManager_Jms
.Nested classes/interfaces inherited from interface io.mats3.impl.jms.JmsMatsTransactionManager
JmsMatsTransactionManager.JmsMatsTxContextKey, JmsMatsTransactionManager.ProcessingLambda, JmsMatsTransactionManager.TransactionContext
-
Field Summary
Fields inherited from interface io.mats3.impl.jms.JmsMatsStatics
EXTRA_GRACE_MILLIS, ILLEGAL_CALL_FLOWS, JMS_MSG_PROP_AUDIT, JMS_MSG_PROP_DISPATCH_TYPE, JMS_MSG_PROP_FROM, JMS_MSG_PROP_INITIALIZING_APP, JMS_MSG_PROP_INITIATOR_ID, JMS_MSG_PROP_MATS_MESSAGE_ID, JMS_MSG_PROP_MESSAGE_TYPE, JMS_MSG_PROP_TO, JMS_MSG_PROP_TRACE_ID, LOG_PREFIX, MAX_STACK_HEIGHT, MAX_TOTAL_CALL_NUMBER, MDC_MATS_APP_NAME, MDC_MATS_APP_VERSION, MDC_MATS_CALL_NUMBER, MDC_MATS_IN_MESSAGE_SYSTEM_ID, MDC_MATS_INIT, MDC_MATS_OUT_MATS_MESSAGE_ID, MDC_MATS_STAGE, MDC_MATS_STAGE_ID, MDC_MATS_STAGE_INDEX, MDC_TRACE_ID, NO_INVOCATION_POINT, RANDOM_ALPHABET, THREAD_PREFIX, TOTAL_JMS_MSG_PROPS_SIZE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic JmsMatsTransactionManager
create()
Provides an implementation ofJmsMatsTransactionManager.TransactionContext
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.mats3.impl.jms.JmsMatsStatics
createFlowId, getInvocationPoint, id, id, idThis, ms3, produceAndSendMsgSysMessages, randomString, setConcurrencyWithLog, stageOrInit
-
Constructor Details
-
JmsMatsTransactionManager_Jms
protected JmsMatsTransactionManager_Jms()
-
-
Method Details
-
create
-
getTransactionContext
public JmsMatsTransactionManager.TransactionContext getTransactionContext(JmsMatsTransactionManager.JmsMatsTxContextKey txContextKey) Description copied from interface:JmsMatsTransactionManager
Provides an implementation ofJmsMatsTransactionManager.TransactionContext
. (JMS Connection and Session handling is done byJmsMatsJmsSessionHandler
).- Specified by:
getTransactionContext
in interfaceJmsMatsTransactionManager
- Parameters:
txContextKey
- for whichJmsMatsStage
orJmsMatsInitiator
this request forJmsMatsTransactionManager.TransactionContext
is for.- Returns:
- a
JmsMatsTransactionManager.TransactionContext
for the supplied txContextKey.
-