Contexts and Dependency Injection (CDI): Java Platform, Enterprise Edition (Java EE) 5 brought dependency injection (DI) with Convention over Configuration to Enterprise JavaBeans (EJB) 3.0. Java EE 6 introduces the flexible and powerful @Inject dependency injection model (JSR-330 and JSR-299) in addition to the already existing @EJB annotation.
I'm a little confused about which to use in the following situation: Suppose the servlet creates an Application that handles …
jakarta-ee java-ee-6 cdi jboss-weldI'm trying to inject a bean defined in a Spring context into a CDI managed component but I'm not successful. …
java spring jsf cdi jboss-weldI want to have different container configurations in my arquillian.xml and select them in my test. But I am …
java testing jakarta-ee cdi jboss-arquillianI'm trying to create instances of CDI managed beans using the BeanManager rather than Instance .select().get(). This was suggested …
java garbage-collection cdi managed-bean jboss-weldLet's say I have an interface called SocialNetworkService, and three implementations - TwitterService, FacebookService and FriendFeedService. Now I want, whenever …
java cdi jboss-weldI have the following interface public interface IMyMapper<T> {} and the implementation public class MyMapper implements IMyMapper<…
java jakarta-ee cdi java-ee-7I couldn't find any reasonable answer here on SO so I hope it's not a duplicate. So why should I …
java dependency-injection cdiWhen injecting any services, I have two choices : Field injection: @Inject private MyService myService; or Constructor injection: private MyService myService; @…
java dependency-injection sonarqube cdiI am using code like below: public Configuration { private boolean isBatmanCar = someMethod(...); @Produces public Car getCar(@New Car car) { if(…
jakarta-ee cdi weldI am programming in a Java SE environment using WELD-SE for dependency injection. Therefore dependencies of a class look something …
java unit-testing mockito cdi