public static interface MatsStageInterceptor.StageCommonContext extends MatsStageInterceptor.StageInterceptContext
Modifier and Type | Method and Description |
---|---|
long |
getDataAndStateDeserializationNanos() |
int |
getDataSerializedSize() |
java.time.Instant |
getEndpointEnteredTimestamp()
Returns the timestamp when the initial stage of the Endpoint which this Stage belongs to, was entered.
|
long |
getEnvelopeDecompressionNanos() |
long |
getEnvelopeDeserializationNanos() |
int |
getEnvelopeSerializedSize() |
int |
getEnvelopeWireSize() |
java.lang.Object |
getIncomingData() |
MatsOutgoingMessage.MessageType |
getIncomingMessageType() |
<T> java.util.Optional<T> |
getIncomingSameStackHeightExtraState(java.lang.String key,
java.lang.Class<T> type) |
java.util.Optional<java.lang.Object> |
getIncomingState() |
<T> T |
getInterceptContextAttribute(java.lang.String key) |
long |
getMessageSystemDeconstructNanos() |
default int |
getMessageSystemTotalWireSize() |
java.time.Instant |
getPrecedingSameStackHeightOutgoingTimestamp()
Returns the timestamp of the preceding outgoing message on the same stack height as this stage.
|
MatsEndpoint.DetachedProcessContext |
getProcessContext() |
int |
getStateSerializedSize() |
long |
getTotalPreprocessAndDeserializeNanos() |
void |
putInterceptContextAttribute(java.lang.String key,
java.lang.Object value)
Set an attribute on this particular interception, which is shared between the different stages of
interception, and also between all interceptors - use some namespacing to avoid accidental collisions.
|
getStage, getStartedInstant, getStartedNanoTime
void putInterceptContextAttribute(java.lang.String key, java.lang.Object value)
key
- the key name for this intercept context attribute.value
- the value which should be held.<T> T getInterceptContextAttribute(java.lang.String key)
T
- the type of this attribute, to avoid explicit casting - but you should really know the type,
otherwise request Object
.key
- the key name for this intercept context attribute.putInterceptContextAttribute(String, Object)
, null
if there is no such value.MatsEndpoint.DetachedProcessContext getProcessContext()
MatsEndpoint.DetachedProcessContext
for the executing stage - this is overridden in several sub
interfaces to return the actual "live" MatsEndpoint.ProcessContext
.java.time.Instant getEndpointEnteredTimestamp()
MatsStageInterceptor.StageCompletedContext.ProcessResult.REPLY
or
MatsStageInterceptor.StageCompletedContext.ProcessResult.NONE
, then the endpoint is finished, and the current time vs. endpoint entered
timestamp (this method) is the total time this endpoint used.
Note that this is susceptible to time skews between nodes: If the initial stage was run on node A, while
this stage is run on node B, calculations on the timestamp returned from this method (from node A) vs. this
node (B's) System.currentTimeMillis()
is highly dependent on the time synchronization between node A
and node B.getPrecedingSameStackHeightOutgoingTimestamp()
,
MatsEndpoint.DetachedProcessContext.getFromTimestamp()
java.time.Instant getPrecedingSameStackHeightOutgoingTimestamp()
System.currentTimeMillis()
is highly dependent on the time synchronization between node A
and node B.
Note: There is no preceding stage for a REQUEST to the Initial Stage of an Endpoint.
Note: On a Terminator whose corresponding initiation did a REQUEST, the "same stack height" ends up being the
initiator (it is stack height 0). If an initiation goes directly to a Terminator (e.g. "fire-and-forget"
PUBLISH or SEND), again the "same stack height" is the initiator.-1
is returned.getEndpointEnteredTimestamp()
,
MatsEndpoint.DetachedProcessContext.getFromTimestamp()
MatsOutgoingMessage.MessageType getIncomingMessageType()
MatsOutgoingMessage.MessageType
of the incoming message.java.util.Optional<java.lang.Object> getIncomingState()
int getStateSerializedSize()
getIncomingState()
is Optional.empty()
, then this method returns 0.java.lang.Object getIncomingData()
int getDataSerializedSize()
Null
data
might give 0 or 4, or really whatever else the serializer uses to represent null
).<T> java.util.Optional<T> getIncomingSameStackHeightExtraState(java.lang.String key, java.lang.Class<T> type)
MatsOutgoingMessage.MatsEditableOutgoingMessage.setSameStackHeightExtraState(String, Object)
.long getTotalPreprocessAndDeserializeNanos()
MatsStageInterceptor.stageReceived(StageReceivedContext)
; approx. the sum
of the timings below.long getMessageSystemDeconstructNanos()
int getEnvelopeWireSize()
getMessageSystemDeconstructNanos()
. If compression was not
applied, returns the same value as getEnvelopeSerializedSize()
. Note that the returned size
is only the (compressed) Mats envelope, and does not include the size of the messaging system's
message/envelope and any meta-data that Mats adds to this. This means that the message size on the
wire will be larger.long getEnvelopeDecompressionNanos()
0
if no compression was applied, while it will return > 0 if compression was applied.int getEnvelopeSerializedSize()
getEnvelopeWireSize()
too, as the same applies here: This size only refers to the Mats
envelope, not the messaging system's final message size.long getEnvelopeDeserializationNanos()
long getDataAndStateDeserializationNanos()
default int getMessageSystemTotalWireSize()