apress / pro-cdi-2-in-java-ee8 Goto Github PK
View Code? Open in Web Editor NEWSource Code for 'Pro CDI 2 in Java EE 8' by Jan Beernink and Arjan Tijms
License: Other
Source Code for 'Pro CDI 2 in Java EE 8' by Jan Beernink and Arjan Tijms
License: Other
The delegate for multiple beans is not working as described in listing 6.5
When I applied the @Language annotation twice on the delegate field, I got the compilation error related to repeatable annotation.
I didn't find any repeatable annotation in this repository. So, I created a repeatable annotation and applied it to Language annotation.
--------------------------------------
@Retention(RUNTIME)
@Target({ FIELD, PARAMETER, METHOD, TYPE})
public @interface Languages {
Language[] value();
}
--------------------------------------
@Qualifier
@Repeatable(Languages.class)
@Retention(RUNTIME)
@Target(value = {FIELD, PARAMETER, METHOD, TYPE})
public @interface Language {
String value();
}
------------------------------
Inside GreetingDecoratorBean.java
@Inject
@Delegate
@Language("English")
@Language("Dutch")
private GreetingInterface greetingBean;
When I run the QualifiedDelegateDemo.java, decorator was not triggered on any of the qualified beans. I tested this by enabling the decorator in the beans.xml file also with the @priority annotation on decorator class but no change in the result.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.