Package io.mats3.impl.jms
Class JmsMatsStage<R,S,I,Z>
java.lang.Object
io.mats3.impl.jms.JmsMatsStage<R,S,I,Z>
- All Implemented Interfaces:
JmsMatsStartStoppable
,JmsMatsStatics
,MatsConfig.StartStoppable
,MatsStage<R,
S, I>
public class JmsMatsStage<R,S,I,Z>
extends Object
implements MatsStage<R,S,I>, JmsMatsStatics, JmsMatsStartStoppable
The JMS implementation of
MatsStage
.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.mats3.MatsStage
MatsStage.StageConfig<R,
S, I> -
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
ConstructorsConstructorDescriptionJmsMatsStage
(JmsMatsEndpoint<R, S, Z> parentEndpoint, int stageIndex, String stageId, boolean queue, Class<I> incomingClass, Class<S> stateClass, MatsEndpoint.ProcessLambda<R, S, I> processLambda) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Must be implemented to provide your children.JmsMatsStage<R,
S, ?, Z> int
hashCode()
idThis()
void
start()
Starts this stage, thereby firing up the queue processing using a set of threads, the number decided by theMatsConfig.getConcurrency()
for each stage.boolean
stop
(int gracefulShutdownMillis) Stops this stage.toString()
boolean
waitForReceiving
(int timoutMillis) Will wait until at least one processor of the stage has entered its receive-loop.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.mats3.impl.jms.JmsMatsStartStoppable
stopPhase0_SetRunFlagFalse, stopPhase1_CloseSessionIfInReceive, stopPhase2_GracefulWaitAfterRunflagFalse, stopPhase3_InterruptIfStillAlive, stopPhase4_GracefulWaitAfterInterrupt
Methods inherited from interface io.mats3.impl.jms.JmsMatsStatics
createFlowId, getInvocationPoint, id, id, ms3, produceAndSendMsgSysMessages, randomString, setConcurrencyWithLog, stageOrInit
-
Constructor Details
-
JmsMatsStage
-
-
Method Details
-
getStageConfig
- Specified by:
getStageConfig
in interfaceMatsStage<R,
S, I> - Returns:
- the
MatsStage.StageConfig
for this stage.
-
getParentEndpoint
- Specified by:
getParentEndpoint
in interfaceMatsStage<R,
S, I> - Returns:
- the parent
MatsEndpoint
.
-
getNextStage
-
start
public void start()Description copied from interface:MatsStage
Starts this stage, thereby firing up the queue processing using a set of threads, the number decided by theMatsConfig.getConcurrency()
for each stage. Will generally be invoked implicitly byMatsEndpoint.start()
. The only reason for calling this should be if its correspondingMatsStage.stop(int)
method has been invoked to stop processing. -
waitForReceiving
public boolean waitForReceiving(int timoutMillis) Description copied from interface:MatsStage
Will wait until at least one processor of the stage has entered its receive-loop.- Specified by:
waitForReceiving
in interfaceJmsMatsStartStoppable
- Specified by:
waitForReceiving
in interfaceMatsConfig.StartStoppable
- Specified by:
waitForReceiving
in interfaceMatsStage<R,
S, I> - Parameters:
timoutMillis
- number of milliseconds before giving up the wait, returningfalse
. 0 is indefinite wait, negative values are not allowed.- Returns:
true
if the entity started within the timeout,false
if it did not start.
-
stop
public boolean stop(int gracefulShutdownMillis) Description copied from interface:MatsStage
Stops this stage. This may be used to temporarily stop processing of this stage by means of some external monitor/inspecting mechanism (e.g. in cases where it has been showed to produce results that breaks downstream stages or endpoints, or itself produces Dead Letter Queue-entries due to some external problem). It is possible toMatsStage.start()
the stage again.- Specified by:
stop
in interfaceJmsMatsStartStoppable
- Specified by:
stop
in interfaceMatsConfig.StartStoppable
- Specified by:
stop
in interfaceMatsStage<R,
S, I> - Parameters:
gracefulShutdownMillis
- number of milliseconds to let the stage processors wait after having asked for them to shut down, and interrupting them if they have not shut down yet.- Returns:
true
if the running thread(s) were dead when returning,false
otherwise.
-
equals
-
hashCode
public int hashCode() -
idThis
- Specified by:
idThis
in interfaceJmsMatsStatics
-
toString
-
getChildrenStartStoppable
Description copied from interface:JmsMatsStartStoppable
Must be implemented to provide your children.- Specified by:
getChildrenStartStoppable
in interfaceJmsMatsStartStoppable
-