Package io.mats3
Interface MatsEndpoint.EndpointConfig<R,S>
- All Superinterfaces:
MatsConfig
- Enclosing interface:
- MatsEndpoint<R,
S>
Provides for both configuring the endpoint (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 TypeMethodDescriptionClass<?>
boolean
setAttribute
(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 theinteractive
flag set.Sets the origin for this Endpoint, i.e.Methods inherited from interface io.mats3.MatsConfig
getAttribute, getConcurrency, getInteractiveConcurrency, isConcurrencyDefault, isInteractiveConcurrencyDefault, isRunning
-
Method Details
-
getEndpointId
String getEndpointId()- Returns:
- the endpointId if this
MatsEndpoint
.
-
isSubscription
boolean isSubscription()- Returns:
- whether this Endpoint is "subscription based", as when created with
MatsFactory.subscriptionTerminator(String, Class, Class, ProcessTerminatorLambda)
.
-
getReplyClass
- Returns:
- the class that will be sent as reply for this endpoint.
-
getStateClass
- Returns:
- the class used for the endpoint's state.
-
getIncomingClass
Class<?> getIncomingClass()- Returns:
- the class expected for incoming messages to this endpoint (decided by the first
MatsStage
).
-
setOrigin
Sets the origin for this Endpoint, i.e. where it was created. Use this to set something sane if theautomatically created creation info
is useless, as it is when Mats' SpringConfig defines the endpoints (thus it employs this method to set something more informative). 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. -
getOrigin
String getOrigin()- Returns:
- some human-interpretable information about where in the codebase this Endpoint 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 instantiating an exception and introspecting the result. If this
doesn't yield any good result, it can be overridden by
setOrigin(String)
, as is done by Mats' SpringConfig.
-
setAttribute
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 isnull
, the mapping for the specified key is cleared.- Specified by:
setAttribute
in 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:MatsConfig
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
). Will only have effect before theMatsStage
is started. Can be reset by stopping, setting, and restarting. Setting to 0 will invoke default logic.- Specified by:
setConcurrency
in 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:MatsConfig
LikeMatsConfig.setConcurrency(int)
, but changes the "interactive concurrency" specifically - this is relevant for the Mats Flows that are initiated with theinteractive
flag set.- Specified by:
setInteractiveConcurrency
in 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:
-