@Documented @Retention(value=RUNTIME) @Target(value={METHOD,ANNOTATION_TYPE}) @Repeatable(value=MatsMapping.MatsMappings.class) public @interface MatsMapping
Mats Single-stage
Endpoint
or a
Mats
Terminator Endpoint
, depending on whether the method specifies a return type, or is void.
@Dto
: When the endpoint is invoked, it will be set to the incoming
(request) Data Transfer Object - and the argument's type thus also specifies its expected deserialization class. The
method's return type represent the outgoing reply Data Transfer Object.
void
), one method
parameter should be annotated with @Dto
: When the endpoint is invoked, it will be set to the incoming
(typically request - or just "message") Data Transfer Object - and the argument's type thus also specifies its
expected deserialization class. The method's return type represent the outgoing reply Data Transfer Object. In
addition, another method parameter can be annotated with @Sto
, which will be the "State Transfer Object"
- this is the object which an initiator supplied to the
initiate call
when it set this
Terminator endpoint as the replyTo
endpointId.
MatsFactory
the endpoint is created onMatsFactory
s,
you must either have one (and only one) of the factories denoted as @Primary
, or you must qualify
which MatsFactory to use. This can be done by the following means:
@Qualifier(qualifiervalue)
annotation to the @MatsMapping-annotated method - this both
matches a MatsFactory with the same @Qualifier(qualifiervalue)
-annotation, and a MatsFactory whose bean
name is the 'qualifierValue' (this dual-logic is Spring's standard).@SpecialMatsFactory
, or you can make a custom qualification
taking parameters like @SpecialMatsFactory(location="somevalue")
. Whether a qualification matches or not
is evaluated by .equals(..)-semantics.matsFactoryBeanName()
annotation valuematsFactoryQualifierValue()
annotation valuematsFactoryCustomQualifierType()
annotation value (please read the JavaDoc for special
considerations with this).MatsClassMapping
Modifier and Type | Optional Element and Description |
---|---|
java.lang.String |
endpointId
The Mats Endpoint Id that this endpoint should listen to.
|
java.lang.String |
matsFactoryBeanName
Specified the
MatsFactory to use by means of specifying the bean name of the MatsFactory . |
java.lang.Class<? extends java.lang.annotation.Annotation> |
matsFactoryCustomQualifierType
Specifies the
MatsFactory to use by means of a specific qualifier annotation type (which thus must be
meta-annotated with Qualifier ). |
java.lang.String |
matsFactoryQualifierValue
Specified the
MatsFactory to use by means of specifying the @Qualifier value. |
boolean |
subscription
If this MatsEndpoint is subscription based.
|
java.lang.String |
value
Alias for "endpointId", so that if you only need to set the endpointId, you can do so directly:
@MatsMapping("endpointId") |
@AliasFor(value="value") public abstract java.lang.String endpointId
@AliasFor(value="endpointId") public abstract java.lang.String value
@MatsMapping("endpointId")
public abstract boolean subscription
true
on methods that have 'void' as the return type.public abstract java.lang.Class<? extends java.lang.annotation.Annotation> matsFactoryCustomQualifierType
MatsFactory
to use by means of a specific qualifier annotation type (which thus must be
meta-annotated with Qualifier
). Notice that this will search for the custom qualifier annotation
type, as opposed to if you add the annotation to the @MatsMapped-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.
@MatsFactoryCentral
and @MatsFactoryRegionWest
for the example).MatsFactory
is qualified with.public abstract java.lang.String matsFactoryQualifierValue
MatsFactory
to use by means of specifying the @Qualifier
value. 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.MatsFactory
is qualified with.public abstract java.lang.String matsFactoryBeanName
MatsFactory
to use by means of specifying the bean name of the MatsFactory
.MatsFactory
.