Package io.mats3.spring
Annotation Type MatsEndpointSetup
-
@Documented @Retention(RUNTIME) @Target({METHOD,ANNOTATION_TYPE}) @Repeatable(MatsEndpointSetups.class) public @interface MatsEndpointSetupNOTE: You should probably useMatsClassMappingor@MatsMappinginstead - or otherwise consider plain programmatic registration instead of using this feature as it brings very little convenience compared to pure Java. A method annotated with this repeatable annotation specifies a method that shall set up a Multi-Staged Mats Endpoint. Note that as opposed to@MatsMappingandMatsClassMapping, this method will be invoked once at startup to set up the endpoint, and will not be invoked each time when the Mats endpoint gets a message (as is the case with @MatsMapping and @MatsClassMapping). You specify the EndpointId, state STO type and the reply DTO type using annotation parameters. The method is then invoked once during Spring context startup, with aMatsEndpointinstance as argument, as would have been returned bymatsFactory.staged(...)when using programmatic registration. The method should then invokeendpoint.stage(..)andendpoint.lastStage(..)to set up the MatsEndpoint - as you would have done when using programmatic registration. You can also have an argument of typeEndpointConfigto be able to configure the endpoint - but you can also do this using the config getters on the endpoint instance, and for each stage you create (e.g. to set concurrency). Remember again that this is a setup method where you should set up the endpoint, and it is invoked only once during startup, and then never again. In a multi-MatsFactory setup, you may qualify which MatsFactory this Endpoint should be constructed on - read JavaDoc on @MatsMappingfor how this works.- See Also:
MatsMapping,MatsClassMapping
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.StringendpointIdThe Mats Endpoint Id that this endpoint should listen to.java.lang.StringmatsFactoryBeanNameSpecified theMatsFactoryto use by means of specifying the bean name of theMatsFactory.java.lang.Class<? extends java.lang.annotation.Annotation>matsFactoryCustomQualifierTypeSpecifies theMatsFactoryto use by means of a specific qualifier annotation type (which thus must be meta-annotated withQualifier).java.lang.StringmatsFactoryQualifierValueSpecified theMatsFactoryto use by means of specifying the@Qualifiervalue.java.lang.Class<?>replyThe Mats Data Transfer Object class that will be returned by the last stage of the staged endpoint.java.lang.Class<?>stateThe Mats State Transfer Object class that should be employed for all of the stages for this endpoint.java.lang.StringvalueAlias for "endpointId", so that if you only need to set the endpointId, you can do so directly:@MatsEndpointSetup("endpointId")
-
-
-
-
matsFactoryCustomQualifierType
java.lang.Class<? extends java.lang.annotation.Annotation> matsFactoryCustomQualifierType
Specifies theMatsFactoryto use by means of a specific qualifier annotation type (which thus must be meta-annotated withQualifier). Notice that this will search for the custom qualifier annotation type, as opposed to if you add the annotation to the @MatsEndpointSetup-annotated method directly, in which case it "equals" the annotation instance (as Spring also does when performing injection with such qualifiers). The difference comes into play if the annotation has values, where e.g. a@SpecialMatsFactory(location="central")is not equal to@SpecialMatsFactory(location="region_west")- but they are equal when comparing types, as the qualification here does. Thus, if using this qualifier-approach, you should probably not use values on your custom qualifier annotations (instead make separate custom qualifier annotations, e.g.@MatsFactoryCentraland@MatsFactoryRegionWestfor the example).- Returns:
- the custom qualifier type which the wanted
MatsFactoryis qualified with.
- Default:
- java.lang.annotation.Annotation.class
-
-
-
matsFactoryQualifierValue
java.lang.String matsFactoryQualifierValue
Specified theMatsFactoryto use by means of specifying the@Qualifiervalue. Spring performs such lookup by first looking for actual qualifiers with the specified value, e.g.@Qualifier(value="the_value"). If this does not produce a result, it will try to find a bean with this value as the bean name.- Returns:
- the qualifier value which the wanted
MatsFactoryis qualified with.
- Default:
- ""
-
-