@Documented @Retention(value=RUNTIME) @Target(value={METHOD,ANNOTATION_TYPE}) @Repeatable(value=MatsEndpointSetup.MatsEndpointSetups.class) public @interface MatsEndpointSetup
@MatsMapping
, this method will be invoked
once to set up the endpoint, and will not be invoked each time when the Mats endpoint is invoked (as
is the case with @MatsMapping). You might want to check up on the MatsClassMapping
instead.
You specify the EndpointId, state STO type and the reply DTO type using annotation parameters. The method is then
invoked with a MatsEndpoint
instance as argument, and the method should then invoke
endpoint.stage(..)
and
endpoint.lastStage(..)
to set up the MatsEndpoint. You can
also have an argument of type MatsEndpoint.EndpointConfig
to be able to configure the endpoint. 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 @MatsMapping
for how this works.MatsMapping
,
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. |
java.lang.Class<?> |
reply
The Mats Data Transfer Object class that will be returned by the last stage of the staged endpoint.
|
java.lang.Class<?> |
state
The Mats State Transfer Object class that should be employed for all of the stages for this endpoint.
|
java.lang.String |
value
Alias for "endpointId", so that if you only need to set the endpointId, you can do so directly:
@MatsEndpointSetup("endpointId") |
@AliasFor(value="value") public abstract java.lang.String endpointId
@AliasFor(value="endpointId") public abstract java.lang.String value
@MatsEndpointSetup("endpointId")
public abstract java.lang.Class<?> state
public abstract java.lang.Class<?> reply
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 @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.
@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
.