Interface SyntheticObserverBuilder<T>
- 
- Type Parameters:
- T- the observed event type of this synthetic observer
 
 public interface SyntheticObserverBuilder<T>Builder for synthetic observers. Instances are not reusable. For each synthetic observer, new instance must be created bySyntheticComponents.addObserver(Class)orSyntheticComponents.addObserver(Type).- Since:
- 4.0
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description SyntheticObserverBuilder<T>async(boolean isAsync)Marks this synthetic observer as asynchronous if desired.SyntheticObserverBuilder<T>declaringClass(ClassInfo declaringClass)Sets the bean class that "declares" this synthetic observer.SyntheticObserverBuilder<T>declaringClass(Class<?> declaringClass)Sets the bean class that "declares" this synthetic observer.SyntheticObserverBuilder<T>observeWith(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(AnnotationInfo qualifierAnnotation)Adds given annotation to the set of qualifiers of this synthetic observer.SyntheticObserverBuilder<T>qualifier(Annotation qualifierAnnotation)Adds given annotation to the set of qualifiers of this synthetic observer.SyntheticObserverBuilder<T>qualifier(Class<? extends Annotation> annotationType)Adds a marker annotation of given type to the set of qualifiers of this synthetic observer.SyntheticObserverBuilder<T>transactionPhase(TransactionPhase transactionPhase)Sets theTransactionPhaseduring which this synthetic observer should be notified.SyntheticObserverBuilder<T>withParam(String key, boolean value)Adds aboolean-valued parameter to the parameter map.SyntheticObserverBuilder<T>withParam(String key, boolean[] value)Adds abooleanarray-valued parameter to the parameter map.SyntheticObserverBuilder<T>withParam(String key, double value)Adds adouble-valued parameter to the parameter map.SyntheticObserverBuilder<T>withParam(String key, double[] value)Adds adoublearray-valued parameter to the parameter map.SyntheticObserverBuilder<T>withParam(String key, int value)Adds anint-valued parameter to the parameter map.SyntheticObserverBuilder<T>withParam(String key, int[] value)Adds anintarray-valued parameter to the parameter map.SyntheticObserverBuilder<T>withParam(String key, long value)Adds along-valued parameter to the parameter map.SyntheticObserverBuilder<T>withParam(String key, long[] value)Adds alongarray-valued parameter to the parameter map.SyntheticObserverBuilder<T>withParam(String key, AnnotationInfo value)Adds an annotation-valued parameter to the parameter map.SyntheticObserverBuilder<T>withParam(String key, AnnotationInfo[] value)Adds an annotation array-valued parameter to the parameter map.SyntheticObserverBuilder<T>withParam(String key, ClassInfo value)Adds aClass-valued parameter to the parameter map.SyntheticObserverBuilder<T>withParam(String key, ClassInfo[] value)Adds aClassarray-valued parameter to the parameter map.SyntheticObserverBuilder<T>withParam(String key, Annotation value)Adds an annotation-valued parameter to the parameter map.SyntheticObserverBuilder<T>withParam(String key, Annotation[] value)Adds an annotation array-valued parameter to the parameter map.SyntheticObserverBuilder<T>withParam(String key, Class<?> value)Adds aClass-valued parameter to the parameter map.SyntheticObserverBuilder<T>withParam(String key, Class<?>[] value)Adds aClassarray-valued parameter to the parameter map.SyntheticObserverBuilder<T>withParam(String key, Enum<?> value)Adds an enum-valued parameter to the parameter map.SyntheticObserverBuilder<T>withParam(String key, Enum<?>[] value)Adds an enum array-valued parameter to the parameter map.SyntheticObserverBuilder<T>withParam(String key, String value)Adds aString-valued parameter to the parameter map.SyntheticObserverBuilder<T>withParam(String key, String[] value)Adds aStringarray-valued parameter to the parameter map.
 
- 
- 
- 
Method Detail- 
declaringClassSyntheticObserverBuilder<T> declaringClass(Class<?> declaringClass) Sets the bean class that "declares" this synthetic observer.If not called, the class declaring the extension which creates this synthetic observer is used. - Parameters:
- declaringClass- bean class that "declares" this synthetic observer, must not be- null
- Returns:
- this SyntheticObserverBuilder
- Throws:
- IllegalStateException- if this method is called multiple times
 
 - 
declaringClassSyntheticObserverBuilder<T> declaringClass(ClassInfo declaringClass) Sets the bean class that "declares" this synthetic observer.If not called, the class declaring the extension which creates this synthetic observer is used. - Parameters:
- declaringClass- bean class that "declares" this synthetic observer, must not be- null
- Returns:
- this SyntheticObserverBuilder
- Throws:
- IllegalStateException- if this method is called multiple times
 
 - 
qualifierSyntheticObserverBuilder<T> qualifier(Class<? extends Annotation> annotationType) Adds a marker annotation of given type to the set of qualifiers of this synthetic observer. This method may be called multiple times to add multiple qualifiers.If not called, this synthetic observer will have no qualifier. - Parameters:
- annotationType- the type of the marker annotation, must not be- null
- Returns:
- this SyntheticObserverBuilder
 
 - 
qualifierSyntheticObserverBuilder<T> qualifier(AnnotationInfo qualifierAnnotation) Adds given annotation to the set of qualifiers of this synthetic observer. This method may be called multiple times to add multiple qualifiers.If not called, this synthetic observer will have no qualifier. - Parameters:
- qualifierAnnotation- the annotation, must not be- null
- Returns:
- this SyntheticObserverBuilder
 
 - 
qualifierSyntheticObserverBuilder<T> qualifier(Annotation qualifierAnnotation) Adds given annotation to the set of qualifiers of this synthetic observer. This method may be called multiple times to add multiple qualifiers.If not called, this synthetic observer will have no qualifier. - Parameters:
- qualifierAnnotation- the annotation, must not be- null
- Returns:
- this SyntheticObserverBuilder
 
 - 
prioritySyntheticObserverBuilder<T> priority(int priority) Sets a priority of this synthetic observer.If not called, this synthetic observer will have a default priority of Priority.APPLICATION+ 500.- Parameters:
- priority- the priority of this synthetic observer
- Returns:
- this SyntheticObserverBuilder
- Throws:
- IllegalStateException- if this method is called multiple times
 
 - 
asyncSyntheticObserverBuilder<T> async(boolean isAsync) Marks this synthetic observer as asynchronous if desired.If not called, this synthetic observer will not be asynchronous. - Parameters:
- isAsync- whether this synthetic observer should be asynchronous
- Returns:
- this SyntheticObserverBuilder
- Throws:
- IllegalStateException- if this method is called multiple times
 
 - 
transactionPhaseSyntheticObserverBuilder<T> transactionPhase(TransactionPhase transactionPhase) Sets theTransactionPhaseduring which this synthetic observer should be notified. If anything else thanTransactionPhase.IN_PROGRESSis 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. - Parameters:
- transactionPhase- the- TransactionPhase, must not be- null
- Returns:
- this SyntheticObserverBuilder
- Throws:
- IllegalStateException- if this method is called multiple times
 
 - 
withParamSyntheticObserverBuilder<T> withParam(String key, boolean value) Adds aboolean-valued parameter to the parameter map. The parameter map is passed to the event notification function when the event is fired.- Parameters:
- key- the parameter key, must not be- null
- value- the parameter value
- Returns:
- this SyntheticObserverBuilder
 
 - 
withParamSyntheticObserverBuilder<T> withParam(String key, boolean[] value) Adds abooleanarray-valued parameter to the parameter map. The parameter map is passed to the event notification function when the event is fired.- Parameters:
- key- the parameter key, must not be- null
- value- the parameter value
- Returns:
- this SyntheticObserverBuilder
 
 - 
withParamSyntheticObserverBuilder<T> withParam(String key, int value) Adds anint-valued parameter to the parameter map. The parameter map is passed to the event notification function when the event is fired.- Parameters:
- key- the parameter key, must not be- null
- value- the parameter value
- Returns:
- this SyntheticObserverBuilder
 
 - 
withParamSyntheticObserverBuilder<T> withParam(String key, int[] value) Adds anintarray-valued parameter to the parameter map. The parameter map is passed to the event notification function when the event is fired.- Parameters:
- key- the parameter key, must not be- null
- value- the parameter value
- Returns:
- this SyntheticObserverBuilder
 
 - 
withParamSyntheticObserverBuilder<T> withParam(String key, long value) Adds along-valued parameter to the parameter map. The parameter map is passed to the event notification function when the event is fired.- Parameters:
- key- the parameter key, must not be- null
- value- the parameter value
- Returns:
- this SyntheticObserverBuilder
 
 - 
withParamSyntheticObserverBuilder<T> withParam(String key, long[] value) Adds alongarray-valued parameter to the parameter map. The parameter map is passed to the event notification function when the event is fired.- Parameters:
- key- the parameter key, must not be- null
- value- the parameter value
- Returns:
- this SyntheticObserverBuilder
 
 - 
withParamSyntheticObserverBuilder<T> withParam(String key, double value) Adds adouble-valued parameter to the parameter map. The parameter map is passed to the event notification function when the event is fired.- Parameters:
- key- the parameter key, must not be- null
- value- the parameter value
- Returns:
- this SyntheticObserverBuilder
 
 - 
withParamSyntheticObserverBuilder<T> withParam(String key, double[] value) Adds adoublearray-valued parameter to the parameter map. The parameter map is passed to the event notification function when the event is fired.- Parameters:
- key- the parameter key, must not be- null
- value- the parameter value
- Returns:
- this SyntheticObserverBuilder
 
 - 
withParamSyntheticObserverBuilder<T> withParam(String key, String value) Adds aString-valued parameter to the parameter map. The parameter map is passed to the event notification function when the event is fired.- Parameters:
- key- the parameter key, must not be- null
- value- the parameter value
- Returns:
- this SyntheticObserverBuilder
 
 - 
withParamSyntheticObserverBuilder<T> withParam(String key, String[] value) Adds aStringarray-valued parameter to the parameter map. The parameter map is passed to the event notification function when the event is fired.- Parameters:
- key- the parameter key, must not be- null
- value- the parameter value
- Returns:
- this SyntheticObserverBuilder
 
 - 
withParamSyntheticObserverBuilder<T> withParam(String key, Enum<?> value) Adds an enum-valued parameter to the parameter map. The parameter map is passed to the event notification function when the event is fired.- Parameters:
- key- the parameter key, must not be- null
- value- the parameter value
- Returns:
- this SyntheticObserverBuilder
 
 - 
withParamSyntheticObserverBuilder<T> withParam(String key, Enum<?>[] value) Adds an enum array-valued parameter to the parameter map. The parameter map is passed to the event notification function when the event is fired.- Parameters:
- key- the parameter key, must not be- null
- value- the parameter value
- Returns:
- this SyntheticObserverBuilder
 
 - 
withParamSyntheticObserverBuilder<T> withParam(String key, Class<?> value) Adds aClass-valued parameter to the parameter map. The parameter map is passed to the event notification function when the event is fired.- Parameters:
- key- the parameter key, must not be- null
- value- the parameter value
- Returns:
- this SyntheticObserverBuilder
 
 - 
withParamSyntheticObserverBuilder<T> withParam(String key, ClassInfo value) Adds aClass-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 aClassInfo.- Parameters:
- key- the parameter key, must not be- null
- value- the parameter value
- Returns:
- this SyntheticObserverBuilder
 
 - 
withParamSyntheticObserverBuilder<T> withParam(String key, Class<?>[] value) Adds aClassarray-valued parameter to the parameter map. The parameter map is passed to the event notification function when the event is fired.- Parameters:
- key- the parameter key, must not be- null
- value- the parameter value
- Returns:
- this SyntheticObserverBuilder
 
 - 
withParamSyntheticObserverBuilder<T> withParam(String key, ClassInfo[] value) Adds aClassarray-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, notClassInfo.- Parameters:
- key- the parameter key, must not be- null
- value- the parameter value
- Returns:
- this SyntheticObserverBuilder
 
 - 
withParamSyntheticObserverBuilder<T> withParam(String key, AnnotationInfo value) Adds an annotation-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 the annotation type, not an AnnotationInfo.- Parameters:
- key- the parameter key, must not be- null
- value- the parameter value
- Returns:
- this SyntheticObserverBuilder
 
 - 
withParamSyntheticObserverBuilder<T> withParam(String key, Annotation value) Adds an annotation-valued parameter to the parameter map. The parameter map is passed to the event notification function when the event is fired.- Parameters:
- key- the parameter key, must not be- null
- value- the parameter value
- Returns:
- this SyntheticObserverBuilder
 
 - 
withParamSyntheticObserverBuilder<T> withParam(String key, AnnotationInfo[] value) Adds an annotation 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 the corresponding annotation types, not AnnotationInfo.- Parameters:
- key- the parameter key, must not be- null
- value- the parameter value
- Returns:
- this SyntheticObserverBuilder
 
 - 
withParamSyntheticObserverBuilder<T> withParam(String key, Annotation[] value) Adds an annotation array-valued parameter to the parameter map. The parameter map is passed to the event notification function when the event is fired.- Parameters:
- key- the parameter key, must not be- null
- value- the parameter value
- Returns:
- this SyntheticObserverBuilder
 
 - 
observeWithSyntheticObserverBuilder<T> observeWith(Class<? extends SyntheticObserver<T>> observerClass) Sets the class of the synthetic observer event notification function. CDI container will create an instance of the event notification function every time when it needs to notify the synthetic observer. The class must bepublicand have apubliczero-parameter constructor; it must not be a bean.If not called, the synthetic observer registration will fail. - Parameters:
- observerClass- the event notification function class, must not be- null
- Returns:
- this SyntheticObserverBuilder
- Throws:
- IllegalStateException- if this method is called multiple times
 
 
- 
 
-