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 TypeMethodDescriptionbooleanMust be implemented to provide your children.JmsMatsStage<R,S, ?, Z> inthashCode()idThis()voidstart()Starts this stage, thereby firing up the queue processing using a set of threads, the number decided by theMatsConfig.getConcurrency()for each stage.booleanstop(int gracefulShutdownMillis) Stops this stage.toString()booleanwaitForReceiving(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, waitMethods inherited from interface io.mats3.impl.jms.JmsMatsStartStoppable
stopPhase0_SetRunFlagFalse, stopPhase1_CloseSessionIfInReceive, stopPhase2_GracefulWaitAfterRunflagFalse, stopPhase3_InterruptIfStillAlive, stopPhase4_GracefulWaitAfterInterruptMethods 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:
getStageConfigin interfaceMatsStage<R,S, I> - Returns:
- the
MatsStage.StageConfigfor this stage.
-
getParentEndpoint
- Specified by:
getParentEndpointin interfaceMatsStage<R,S, I> - Returns:
- the parent
MatsEndpoint.
-
getNextStage
-
start
public void start()Description copied from interface:MatsStageStarts 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:MatsStageWill wait until at least one processor of the stage has entered its receive-loop.- Specified by:
waitForReceivingin interfaceJmsMatsStartStoppable- Specified by:
waitForReceivingin interfaceMatsConfig.StartStoppable- Specified by:
waitForReceivingin 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:
trueif the entity started within the timeout,falseif it did not start.
-
stop
public boolean stop(int gracefulShutdownMillis) Description copied from interface:MatsStageStops 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:
stopin interfaceJmsMatsStartStoppable- Specified by:
stopin interfaceMatsConfig.StartStoppable- Specified by:
stopin 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:
trueif the running thread(s) were dead when returning,falseotherwise.
-
equals
-
hashCode
public int hashCode() -
idThis
- Specified by:
idThisin interfaceJmsMatsStatics
-
toString
-
getChildrenStartStoppable
Description copied from interface:JmsMatsStartStoppableMust be implemented to provide your children.- Specified by:
getChildrenStartStoppablein interfaceJmsMatsStartStoppable
-