Package io.mats3

Interface MatsStage.StageConfig<R,S,I>

All Superinterfaces:
MatsConfig
Enclosing interface:
MatsStage<R,S,I>

public static interface MatsStage.StageConfig<R,S,I> extends MatsConfig
Provides for both configuring the stage (before it is started), and introspecting the configuration.
  • 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's endpointId. 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

      Class<I> 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

      MatsStage.StageConfig<R,S,I> setOrigin(String info)
      Sets the origin for this Stage, i.e. where it was created. Use this to set something sane if the automatically created creation info is 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

      MatsStage.StageConfig<R,S,I> setAttribute(String key, Object value)
      Description copied from interface: MatsConfig
      Sets an attribute for this entity (factory, endpoint, stage) - can e.g. be used by tooling or interceptors. If the value is null, the mapping for the specified key is cleared.
      Specified by:
      setAttribute in interface MatsConfig
      Parameters:
      key - the key name for this attribute. Not null.
      value - the value for this attribute. If the value is null, the mapping for the specified key is cleared.
      Returns:
      the config object, for method chaining.
    • setConcurrency

      MatsStage.StageConfig<R,S,I> setConcurrency(int concurrency)
      Description copied from interface: MatsConfig
      Changes the default concurrency of the Factory, or of the endpoint (which defaults to the concurrency of the MatsFactory), or of the process stage (which defaults to the concurrency of the MatsEndpoint).

      Will only have effect before the MatsStage is started. Can be reset by stopping, setting, and restarting.

      Setting to 0 will invoke default logic.

      Specified by:
      setConcurrency in interface MatsConfig
      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

      MatsStage.StageConfig<R,S,I> setInteractiveConcurrency(int concurrency)
      Description copied from interface: MatsConfig
      Like MatsConfig.setConcurrency(int), but changes the "interactive concurrency" specifically - this is relevant for the Mats Flows that are initiated with the interactive flag set.
      Specified by:
      setInteractiveConcurrency in interface MatsConfig
      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: