T
- the observed event type of this synthetic observerpublic interface SyntheticObserverBuilder<T>
SyntheticComponents.addObserver(Class)
or SyntheticComponents.addObserver(Type)
.Modifier and Type | Method and Description |
---|---|
SyntheticObserverBuilder<T> |
async(boolean isAsync)
Marks this synthetic observer as asynchronous if desired.
|
SyntheticObserverBuilder<T> |
declaringClass(java.lang.Class<?> declaringClass)
Sets the bean class that "declares" this synthetic observer.
|
SyntheticObserverBuilder<T> |
declaringClass(ClassInfo declaringClass)
Sets the bean class that "declares" this synthetic observer.
|
SyntheticObserverBuilder<T> |
observeWith(java.lang.Class<? extends SyntheticObserver<T>> observerClass)
Sets the class of the synthetic observer event notification function.
|
SyntheticObserverBuilder<T> |
priority(int priority)
Sets a priority of this synthetic observer.
|
SyntheticObserverBuilder<T> |
qualifier(java.lang.annotation.Annotation qualifierAnnotation)
Adds given annotation to the set of qualifiers of this synthetic observer.
|
SyntheticObserverBuilder<T> |
qualifier(AnnotationInfo qualifierAnnotation)
Adds given annotation to the set of qualifiers of this synthetic observer.
|
SyntheticObserverBuilder<T> |
qualifier(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Adds a marker annotation of given type to the set of qualifiers of this synthetic observer.
|
SyntheticObserverBuilder<T> |
transactionPhase(TransactionPhase transactionPhase)
Sets the
TransactionPhase during which this synthetic observer should be notified. |
SyntheticObserverBuilder<T> |
withParam(java.lang.String key,
java.lang.annotation.Annotation value)
Adds an annotation-valued parameter to the parameter map.
|
SyntheticObserverBuilder<T> |
withParam(java.lang.String key,
java.lang.annotation.Annotation[] value)
Adds an annotation array-valued parameter to the parameter map.
|
SyntheticObserverBuilder<T> |
withParam(java.lang.String key,
AnnotationInfo value)
Adds an annotation-valued parameter to the parameter map.
|
SyntheticObserverBuilder<T> |
withParam(java.lang.String key,
AnnotationInfo[] value)
Adds an annotation array-valued parameter to the parameter map.
|
SyntheticObserverBuilder<T> |
withParam(java.lang.String key,
boolean value)
Adds a
boolean -valued parameter to the parameter map. |
SyntheticObserverBuilder<T> |
withParam(java.lang.String key,
boolean[] value)
Adds a
boolean array-valued parameter to the parameter map. |
SyntheticObserverBuilder<T> |
withParam(java.lang.String key,
java.lang.Class<?> value)
Adds a
Class -valued parameter to the parameter map. |
SyntheticObserverBuilder<T> |
withParam(java.lang.String key,
java.lang.Class<?>[] value)
Adds a
Class array-valued parameter to the parameter map. |
SyntheticObserverBuilder<T> |
withParam(java.lang.String key,
ClassInfo value)
Adds a
Class -valued parameter to the parameter map. |
SyntheticObserverBuilder<T> |
withParam(java.lang.String key,
ClassInfo[] value)
Adds a
Class array-valued parameter to the parameter map. |
SyntheticObserverBuilder<T> |
withParam(java.lang.String key,
double value)
Adds a
double -valued parameter to the parameter map. |
SyntheticObserverBuilder<T> |
withParam(java.lang.String key,
double[] value)
Adds a
double array-valued parameter to the parameter map. |
SyntheticObserverBuilder<T> |
withParam(java.lang.String key,
java.lang.Enum<?> value)
Adds an enum-valued parameter to the parameter map.
|
SyntheticObserverBuilder<T> |
withParam(java.lang.String key,
java.lang.Enum<?>[] value)
Adds an enum array-valued parameter to the parameter map.
|
SyntheticObserverBuilder<T> |
withParam(java.lang.String key,
int value)
Adds an
int -valued parameter to the parameter map. |
SyntheticObserverBuilder<T> |
withParam(java.lang.String key,
int[] value)
Adds an
int array-valued parameter to the parameter map. |
SyntheticObserverBuilder<T> |
withParam(java.lang.String key,
long value)
Adds a
long -valued parameter to the parameter map. |
SyntheticObserverBuilder<T> |
withParam(java.lang.String key,
long[] value)
Adds a
long array-valued parameter to the parameter map. |
SyntheticObserverBuilder<T> |
withParam(java.lang.String key,
java.lang.String value)
Adds a
String -valued parameter to the parameter map. |
SyntheticObserverBuilder<T> |
withParam(java.lang.String key,
java.lang.String[] value)
Adds a
String array-valued parameter to the parameter map. |
SyntheticObserverBuilder<T> declaringClass(java.lang.Class<?> declaringClass)
If not called, the class declaring the extension which creates this synthetic observer is used.
declaringClass
- bean class that "declares" this synthetic observer, must not be null
SyntheticObserverBuilder
java.lang.IllegalStateException
- if this method is called multiple timesSyntheticObserverBuilder<T> declaringClass(ClassInfo declaringClass)
If not called, the class declaring the extension which creates this synthetic observer is used.
declaringClass
- bean class that "declares" this synthetic observer, must not be null
SyntheticObserverBuilder
java.lang.IllegalStateException
- if this method is called multiple timesSyntheticObserverBuilder<T> qualifier(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
If not called, this synthetic observer will have no qualifier.
annotationType
- the type of the marker annotation, must not be null
SyntheticObserverBuilder
SyntheticObserverBuilder<T> qualifier(AnnotationInfo qualifierAnnotation)
If not called, this synthetic observer will have no qualifier.
qualifierAnnotation
- the annotation, must not be null
SyntheticObserverBuilder
SyntheticObserverBuilder<T> qualifier(java.lang.annotation.Annotation qualifierAnnotation)
If not called, this synthetic observer will have no qualifier.
qualifierAnnotation
- the annotation, must not be null
SyntheticObserverBuilder
SyntheticObserverBuilder<T> priority(int priority)
If not called, this synthetic observer will have a default priority
of Priority.APPLICATION
+ 500.
priority
- the priority of this synthetic observerSyntheticObserverBuilder
java.lang.IllegalStateException
- if this method is called multiple timesSyntheticObserverBuilder<T> async(boolean isAsync)
If not called, this synthetic observer will not be asynchronous.
isAsync
- whether this synthetic observer should be asynchronousSyntheticObserverBuilder
java.lang.IllegalStateException
- if this method is called multiple timesSyntheticObserverBuilder<T> transactionPhase(TransactionPhase transactionPhase)
TransactionPhase
during which this synthetic observer should be notified.
If anything else than TransactionPhase.IN_PROGRESS
is passed, this synthetic observer
will be a transactional observer.
If not called, this synthetic observer will not be a transactional observer.
In other words, the default is TransactionPhase.IN_PROGRESS
.
Note that transactional observers cannot be asynchronous. If this synthetic observer is configured to be both transactional and asynchronous, its registration will fail.
transactionPhase
- the TransactionPhase
, must not be null
SyntheticObserverBuilder
java.lang.IllegalStateException
- if this method is called multiple timesSyntheticObserverBuilder<T> withParam(java.lang.String key, boolean value)
boolean
-valued parameter to the parameter map. The parameter map is passed
to the event notification function when the event is fired.key
- the parameter key, must not be null
value
- the parameter valueSyntheticObserverBuilder
SyntheticObserverBuilder<T> withParam(java.lang.String key, boolean[] value)
boolean
array-valued parameter to the parameter map. The parameter map is passed
to the event notification function when the event is fired.key
- the parameter key, must not be null
value
- the parameter valueSyntheticObserverBuilder
SyntheticObserverBuilder<T> withParam(java.lang.String key, int value)
int
-valued parameter to the parameter map. The parameter map is passed
to the event notification function when the event is fired.key
- the parameter key, must not be null
value
- the parameter valueSyntheticObserverBuilder
SyntheticObserverBuilder<T> withParam(java.lang.String key, int[] value)
int
array-valued parameter to the parameter map. The parameter map is passed
to the event notification function when the event is fired.key
- the parameter key, must not be null
value
- the parameter valueSyntheticObserverBuilder
SyntheticObserverBuilder<T> withParam(java.lang.String key, long value)
long
-valued parameter to the parameter map. The parameter map is passed
to the event notification function when the event is fired.key
- the parameter key, must not be null
value
- the parameter valueSyntheticObserverBuilder
SyntheticObserverBuilder<T> withParam(java.lang.String key, long[] value)
long
array-valued parameter to the parameter map. The parameter map is passed
to the event notification function when the event is fired.key
- the parameter key, must not be null
value
- the parameter valueSyntheticObserverBuilder
SyntheticObserverBuilder<T> withParam(java.lang.String key, double value)
double
-valued parameter to the parameter map. The parameter map is passed
to the event notification function when the event is fired.key
- the parameter key, must not be null
value
- the parameter valueSyntheticObserverBuilder
SyntheticObserverBuilder<T> withParam(java.lang.String key, double[] value)
double
array-valued parameter to the parameter map. The parameter map is passed
to the event notification function when the event is fired.key
- the parameter key, must not be null
value
- the parameter valueSyntheticObserverBuilder
SyntheticObserverBuilder<T> withParam(java.lang.String key, java.lang.String value)
String
-valued parameter to the parameter map. The parameter map is passed
to the event notification function when the event is fired.key
- the parameter key, must not be null
value
- the parameter valueSyntheticObserverBuilder
SyntheticObserverBuilder<T> withParam(java.lang.String key, java.lang.String[] value)
String
array-valued parameter to the parameter map. The parameter map is passed
to the event notification function when the event is fired.key
- the parameter key, must not be null
value
- the parameter valueSyntheticObserverBuilder
SyntheticObserverBuilder<T> withParam(java.lang.String key, java.lang.Enum<?> value)
key
- the parameter key, must not be null
value
- the parameter valueSyntheticObserverBuilder
SyntheticObserverBuilder<T> withParam(java.lang.String key, java.lang.Enum<?>[] value)
key
- the parameter key, must not be null
value
- the parameter valueSyntheticObserverBuilder
SyntheticObserverBuilder<T> withParam(java.lang.String key, java.lang.Class<?> value)
Class
-valued parameter to the parameter map. The parameter map is passed
to the event notification function when the event is fired.key
- the parameter key, must not be null
value
- the parameter valueSyntheticObserverBuilder
SyntheticObserverBuilder<T> withParam(java.lang.String key, ClassInfo value)
Class
-valued parameter to the parameter map. The parameter map is passed
to the event notification function when the event is fired.
When looked up from the parameter map in the event notification function, the value will be
an instance of Class
, not a ClassInfo
.
key
- the parameter key, must not be null
value
- the parameter valueSyntheticObserverBuilder
SyntheticObserverBuilder<T> withParam(java.lang.String key, java.lang.Class<?>[] value)
Class
array-valued parameter to the parameter map. The parameter map is passed
to the event notification function when the event is fired.key
- the parameter key, must not be null
value
- the parameter valueSyntheticObserverBuilder
SyntheticObserverBuilder<T> withParam(java.lang.String key, ClassInfo[] value)
Class
array-valued parameter to the parameter map. The parameter map is passed
to the event notification function when the event is fired.
When looked up from the parameter map in the event notification function, the values will be
instances of Class
, not ClassInfo
.
key
- the parameter key, must not be null
value
- the parameter valueSyntheticObserverBuilder
SyntheticObserverBuilder<T> withParam(java.lang.String key, AnnotationInfo value)
When looked up from the parameter map in the event notification function, the value will be
an instance of the annotation type, not an AnnotationInfo
.
key
- the parameter key, must not be null
value
- the parameter valueSyntheticObserverBuilder
SyntheticObserverBuilder<T> withParam(java.lang.String key, java.lang.annotation.Annotation value)
key
- the parameter key, must not be null
value
- the parameter valueSyntheticObserverBuilder
SyntheticObserverBuilder<T> withParam(java.lang.String key, AnnotationInfo[] value)
When looked up from the parameter map in the event notification function, the values will be
instances of the corresponding annotation types, not AnnotationInfo
.
key
- the parameter key, must not be null
value
- the parameter valueSyntheticObserverBuilder
SyntheticObserverBuilder<T> withParam(java.lang.String key, java.lang.annotation.Annotation[] value)
key
- the parameter key, must not be null
value
- the parameter valueSyntheticObserverBuilder
SyntheticObserverBuilder<T> observeWith(java.lang.Class<? extends SyntheticObserver<T>> observerClass)
public
and have a public
zero-parameter constructor; it must not be a bean.
If not called, the synthetic observer registration will fail.
observerClass
- the event notification function class, must not be null
SyntheticObserverBuilder
java.lang.IllegalStateException
- if this method is called multiple times