public class JmsMatsStage<R,S,I,Z> extends java.lang.Object implements MatsStage<R,S,I>, JmsMatsStatics, JmsMatsStartStoppable
MatsStage
.MatsStage.StageConfig<R,S,I>
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
Constructor and Description |
---|
JmsMatsStage(JmsMatsEndpoint<R,S,Z> parentEndpoint,
int stageIndex,
java.lang.String stageId,
boolean queue,
java.lang.Class<I> incomingClass,
java.lang.Class<S> stateClass,
MatsEndpoint.ProcessLambda<R,S,I> processLambda) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.util.List<JmsMatsStartStoppable> |
getChildrenStartStoppable()
Must be implemented to provide your children.
|
JmsMatsStage<R,S,?,Z> |
getNextStage() |
JmsMatsEndpoint<R,S,Z> |
getParentEndpoint() |
MatsStage.StageConfig<R,S,I> |
getStageConfig() |
int |
hashCode() |
java.lang.String |
idThis() |
void |
start()
Starts this stage, thereby firing up the queue processing using a set of threads, the number decided by the
MatsConfig.getConcurrency() for each stage. |
boolean |
stop(int gracefulShutdownMillis)
Stops this stage.
|
java.lang.String |
toString() |
boolean |
waitForReceiving(int timoutMillis)
Will wait until at least one processor of the stage has entered its receive-loop.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
stopPhase0_SetRunFlagFalse, stopPhase1_CloseSessionIfInReceive, stopPhase2_GracefulWaitAfterRunflagFalse, stopPhase3_InterruptIfStillAlive, stopPhase4_GracefulWaitAfterInterrupt
createFlowId, getInvocationPoint, handleIncomingMessageMatsObject, handleIncomingState, id, id, ms3, produceAndSendMsgSysMessages, randomString, setConcurrencyWithLog, stageOrInit
public JmsMatsStage(JmsMatsEndpoint<R,S,Z> parentEndpoint, int stageIndex, java.lang.String stageId, boolean queue, java.lang.Class<I> incomingClass, java.lang.Class<S> stateClass, MatsEndpoint.ProcessLambda<R,S,I> processLambda)
public MatsStage.StageConfig<R,S,I> getStageConfig()
getStageConfig
in interface MatsStage<R,S,I>
MatsStage.StageConfig
for this stage.public JmsMatsEndpoint<R,S,Z> getParentEndpoint()
getParentEndpoint
in interface MatsStage<R,S,I>
MatsEndpoint
.public JmsMatsStage<R,S,?,Z> getNextStage()
public void start()
MatsStage
MatsConfig.getConcurrency()
for each stage.
Will generally be invoked implicitly by MatsEndpoint.start()
. The only reason for calling this should be
if its corresponding MatsStage.stop(int)
method has been invoked to stop processing.public boolean waitForReceiving(int timoutMillis)
MatsStage
waitForReceiving
in interface JmsMatsStartStoppable
waitForReceiving
in interface MatsConfig.StartStoppable
waitForReceiving
in interface MatsStage<R,S,I>
timoutMillis
- number of milliseconds before giving up the wait, returning false
. 0 is indefinite
wait, negative values are not allowed.true
if the entity started within the timeout, false
if it did not start.public boolean stop(int gracefulShutdownMillis)
MatsStage
MatsStage.start()
the stage again.stop
in interface JmsMatsStartStoppable
stop
in interface MatsConfig.StartStoppable
stop
in interface MatsStage<R,S,I>
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.true
if the running thread(s) were dead when returning, false
otherwise.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String idThis()
idThis
in interface JmsMatsStatics
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.List<JmsMatsStartStoppable> getChildrenStartStoppable()
JmsMatsStartStoppable
getChildrenStartStoppable
in interface JmsMatsStartStoppable