public class JmsMatsJmsSessionHandler_Simple extends java.lang.Object implements JmsMatsJmsSessionHandler, JmsMatsStatics
JmsMatsJmsSessionHandler
which does nothing of pooling nor connection
sharing. For StageProcessors (endpoints), this actually is one of the interesting options: Each StageProcessor has
its own Connection with a sole Session. But for Initiators, it is pretty bad: Each initiation constructs one
Connection (with a sole Session), and then closes the whole thing down after the initiation is done (message(s) is
sent).Modifier and Type | Class and Description |
---|---|
class |
JmsMatsJmsSessionHandler_Simple.JmsSessionHolder_Simple |
JmsMatsJmsSessionHandler.JmsSessionHolder
Modifier and Type | Field and Description |
---|---|
protected javax.jms.ConnectionFactory |
_jmsConnectionFactory |
protected java.util.concurrent.atomic.AtomicInteger |
_numberOfOutstandingConnections |
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_TRACE_ID, NO_INVOCATION_POINT, RANDOM_ALPHABET, THREAD_PREFIX, TOTAL_JMS_MSG_PROPS_SIZE
Modifier | Constructor and Description |
---|---|
protected |
JmsMatsJmsSessionHandler_Simple(javax.jms.ConnectionFactory jmsConnectionFactory) |
Modifier and Type | Method and Description |
---|---|
int |
closeAllAvailableSessions()
Closes all Available Session, does not touch Employed.
|
static JmsMatsJmsSessionHandler_Simple |
create(javax.jms.ConnectionFactory connectionFactory) |
protected JmsMatsJmsSessionHandler.JmsSessionHolder |
getSessionHolder_internal(JmsMatsTransactionManager.JmsMatsTxContextKey txContextKey) |
JmsMatsJmsSessionHandler.JmsSessionHolder |
getSessionHolder(io.mats3.impl.jms.JmsMatsInitiator<?> initiator)
Will be invoked every time an Initiator wants to send a message - it will be returned after the message(s) is
sent.
|
JmsMatsJmsSessionHandler.JmsSessionHolder |
getSessionHolder(io.mats3.impl.jms.JmsMatsStageProcessor<?,?,?,?> stageProcessor)
Will be invoked before the StageProcessor goes into its consumer loop - it will be closed once the Stage is
stopped, or if the Session "crashes", i.e.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createFlowId, getInvocationPoint, handleIncomingMessageMatsObject, handleIncomingState, id, id, idThis, ms3, produceAndSendMsgSysMessages, randomString, setConcurrencyWithLog, stageOrInit
protected final javax.jms.ConnectionFactory _jmsConnectionFactory
protected java.util.concurrent.atomic.AtomicInteger _numberOfOutstandingConnections
protected JmsMatsJmsSessionHandler_Simple(javax.jms.ConnectionFactory jmsConnectionFactory)
public static JmsMatsJmsSessionHandler_Simple create(javax.jms.ConnectionFactory connectionFactory)
public JmsMatsJmsSessionHandler.JmsSessionHolder getSessionHolder(io.mats3.impl.jms.JmsMatsInitiator<?> initiator) throws JmsMatsException.JmsMatsJmsException
JmsMatsJmsSessionHandler
getSessionHolder
in interface JmsMatsJmsSessionHandler
initiator
- the initiator in question.JmsMatsJmsSessionHandler.JmsSessionHolder
instance - which is not the same as any other SessionHolders concurrently in
use (but it may be pooled, so after a JmsMatsJmsSessionHandler.JmsSessionHolder.release()
, it may be returned to another
invocation again).JmsMatsException.JmsMatsJmsException
- if there was a problem getting a Connection. Problems getting a Sessions (e.g. the current Connection
is broken) should be internally handled (i.e. try to get a new Connection), except if it can be
determined that the problem getting a Session is of a fundamental nature (i.e. the credentials can
get a Connection, but cannot get a Session - which would be pretty absurd, but hey).public JmsMatsJmsSessionHandler.JmsSessionHolder getSessionHolder(io.mats3.impl.jms.JmsMatsStageProcessor<?,?,?,?> stageProcessor) throws JmsMatsException.JmsMatsJmsException
JmsMatsJmsSessionHandler
getSessionHolder
in interface JmsMatsJmsSessionHandler
stageProcessor
- the StageProcessor in question.JmsMatsJmsSessionHandler.JmsSessionHolder
instance - which is unique for each call.JmsMatsException.JmsMatsJmsException
- if there was a problem getting a Connection. Problems getting a Sessions (e.g. the current Connection
is broken) should be internally handled (i.e. try to get a new Connection), except if it can be
determined that the problem getting a Session is of a fundamental nature (i.e. the credentials can
get a Connection, but cannot get a Session - which would be pretty absurd, but hey).public int closeAllAvailableSessions()
JmsMatsJmsSessionHandler
JmsMatsJmsSessionHandler
upon shutdown - the returned value is a count of how many Connections are still
alive after the operation, which should be 0.closeAllAvailableSessions
in interface JmsMatsJmsSessionHandler
protected JmsMatsJmsSessionHandler.JmsSessionHolder getSessionHolder_internal(JmsMatsTransactionManager.JmsMatsTxContextKey txContextKey) throws JmsMatsException.JmsMatsJmsException