Declarative definition of a service that generates a specialized service
loader that takes care of the loading and enforces a specific usage.
- Author:
- Philippe Charles
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionClass<?> Specifies the batch class to use in batch loading.Class<?> Specifies the fallback class to use if no service is available.
This option is only used in conjunction withQuantifier.SINGLE.Specifies the fully qualified name of the loader.
An empty value generates an automatic name.Specifies how many instances are returned by the loader. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName to suppress single-fallback warning using @SuppressWarnings
-
Field Details
-
SINGLE_FALLBACK_NOT_EXPECTED
Name to suppress single-fallback warning using @SuppressWarnings- See Also:
-
-
Element Details
-
quantifier
Quantifier quantifierSpecifies how many instances are returned by the loader.- Returns:
- a non-null quantifier
- Default:
OPTIONAL
-
loaderName
String loaderNameSpecifies the fully qualified name of the loader.
An empty value generates an automatic name. A non-empty value is interpreted as a Mustache template with the following tags:{{packageName}}: The package name of the service class, or "" if this is in the default package.{{simpleName}}: The service class name.{{canonicalName}}: The full service class name.
- Returns:
- a fully qualified name
- Default:
""
-
fallback
Class<?> fallbackSpecifies the fallback class to use if no service is available.
This option is only used in conjunction withQuantifier.SINGLE.Requirements:
- must be assignable to the service type
- must be instantiable either by constructor, static method, enum field or static final field
- Returns:
- the fallback class if required,
Voidotherwise
- Default:
java.lang.Void.class
-
batchType
Class<?> batchTypeSpecifies the batch class to use in batch loading.Requirements:
- Batch type must be an interface or an abstract class
- Batch method must be unique
- Returns:
- the batch class if required,
Voidotherwise
- Default:
java.lang.Void.class
-