Package io.mats3
Interface MatsStage.StageConfig<R,S,I>
- All Superinterfaces:
MatsConfig
Provides for both configuring the stage (before it is started), and introspecting the configuration.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.mats3.MatsConfig
MatsConfig.StartStoppable -
Method Summary
Modifier and TypeMethodDescriptionintintsetAttribute(String key, Object value) Sets an attribute for this entity (factory, endpoint, stage) - can e.g.setConcurrency(int concurrency) Changes the default concurrency of the Factory, or of the endpoint (which defaults to the concurrency of theMatsFactory), or of the process stage (which defaults to the concurrency of theMatsEndpoint).setInteractiveConcurrency(int concurrency) LikeMatsConfig.setConcurrency(int), but changes the "interactive concurrency" specifically - this is relevant for the Mats Flows that are initiated with theinteractiveflag set.Sets the origin for this Stage, i.e.Methods inherited from interface io.mats3.MatsConfig
getAttribute, getConcurrency, getInteractiveConcurrency, isConcurrencyDefault, isInteractiveConcurrencyDefault, isRunning
-
Method Details
-
getStageId
String getStageId()- Returns:
- the stageId for this Stage - for the initial stage of an endpoint, this is the same as the
MatsEndpoint.EndpointConfig.getEndpointId().
-
getStageIndex
int getStageIndex()- Returns:
- the index number of the stage, where 0 is the initial stage where the
getStageId()is equal to the Endpoint'sendpointId. Subsequent stages will have indices 1, 2, 3 etc. This will typically also be reflected in the stageId for all non-initial stages, where their stageIds are equal to"{endpointId}.stage{stageIndex}"(the initial stage is just"{endpointId}", of course).
-
getIncomingClass
- Returns:
- the class expected for incoming messages to this process stage.
-
getRunningStageProcessors
int getRunningStageProcessors()- Returns:
- the currently number of running Stage Processors (the actual concurrency - this might be different
from
MatsConfig.getConcurrency()if the concurrency was set when stage was running.
-
setOrigin
Sets the origin for this Stage, i.e. where it was created. Use this to set something sane if theautomatically created creation infois useless. It should be a single line, no line feeds, but tooling might split the String into multiple lines on the character ';'. It should definitely be short, but informative.- Returns:
this, for chaining.
-
getOrigin
String getOrigin()- Returns:
- some human-interpretable information about where in the codebase this Stage was created. If this is
displayed in a multi-line capable situation, you should split on ';'. An attempt at some automatic
creation is performed, based on creating an exception and introspecting the result. If this doesn't
yield any good result, it might be overridden by
setOrigin(String).
-
setAttribute
Description copied from interface:MatsConfigSets an attribute for this entity (factory, endpoint, stage) - can e.g. be used by tooling or interceptors. If the value isnull, the mapping for the specified key is cleared.- Specified by:
setAttributein interfaceMatsConfig- Parameters:
key- the key name for this attribute. Notnull.value- the value for this attribute. If the value isnull, the mapping for the specified key is cleared.- Returns:
- the config object, for method chaining.
-
setConcurrency
Description copied from interface:MatsConfigChanges the default concurrency of the Factory, or of the endpoint (which defaults to the concurrency of theMatsFactory), or of the process stage (which defaults to the concurrency of theMatsEndpoint). Will only have effect before theMatsStageis started. Can be reset by stopping, setting, and restarting. Setting to 0 will invoke default logic.- Specified by:
setConcurrencyin interfaceMatsConfig- Parameters:
concurrency- the concurrency for the Factory, or Endpoint, or Stage. If set to 0, default-logic is in effect.- Returns:
- the config object, for method chaining.
- See Also:
-
setInteractiveConcurrency
Description copied from interface:MatsConfigLikeMatsConfig.setConcurrency(int), but changes the "interactive concurrency" specifically - this is relevant for the Mats Flows that are initiated with theinteractiveflag set.- Specified by:
setInteractiveConcurrencyin interfaceMatsConfig- Parameters:
concurrency- the interactive concurrency for the Factory, or Endpoint, or Stage. If set to 0, default-logic is in effect.- Returns:
- the config object, for method chaining.
- See Also:
-