Search Results

Search found 4 results on 1 pages for 'jsr299'.

Page 1/1 | 1 

  • Where should I declare my CDI resources?

    - by Laird Nelson
    JSR-299 (CDI) introduces the (unfortunately named) concept of a resource: http://docs.jboss.org/weld/reference/1.0.0/en-US/html/resources.html#d0e4373 You can think of a resource in this nomenclature as a bridge between the Java EE 6 brand of dependency injection (@EJB, @Resource, @PersistenceContext and the like) and CDI's brand of dependency injection. The general gist seems to be that somewhere (and this will be the root of my question) you declare what amounts to a bridge class: it contains fields annotated both with Java EE's @EJB or @PersistenceContext or @Resource annotations and with CDI's @Produces annotations. The net effect is that Java EE 6 injects a persistence context, say, where it's called for, and CDI recognizes that injected PersistenceContext as a source for future injections down the line (handled by @Inject). My question is: what is the community's consensus--or is there one--on: what this bridge class should be named where this bridge class should live whether it's best to localize all this stuff into one class or make several of them ...? Left to my own devices, I was thinking of declaring a single class called CDIResources and using that as the One True Place to link Java EE's DI with CDI's DI. Many examples do something similar, but I'm not clear on whether they're "just" examples or whether that's a good way to do it. Thanks.

    Read the article

  • Can Spring understand @Inject replacing Weld as a JSR-299 implementation?

    - by Thorbjørn Ravn Andersen
    I have noticed from several web pages that apparently Spring 3.0 supports @Inject from JSR-330. As we would really like to use JSR-299 syntax for dependency injection in our libraries for both web apps and stand-alone applications, and have alternatives to Weld, it would be nice if Spring could do this. Being a novice to Spring, I tried downloading the Spring Framework distribution and put all jars on the Eclipse build path. No Inject annotation so my existing test project using Weld did not compile. Can this be done with Spring? What do I need to do to get it running? (I am aware that Guice eventually will support this too. It is only in SVN for now, and if there is an official Spring release which can, that would be better.)

    Read the article

  • Whats the relationship between Spring and javax.enterprise.inject?

    - by HDave
    I was reading a Wikipedia article about Java EE application servers here: http://en.wikipedia.org/wiki/Java_Platform,_Enterprise_Edition#Java_EE_5_certified It says that 2 APIs that Java App Services implement are: javax.enterprise.inject javax.enterprise.context These both relate to application context and dependency injection JSR-299. I had never heard of these APIs before. Does Spring implement these APIs? Would it matter to anyone if they did?

    Read the article

  • Contexts and Dependency Injection(CDI)??

    - by Masa Sasaki
    WebLogic Server?????????????WebLogic Server????????6?20?????????37?WebLogic Server???@????????Contexts and Dependency Injection(CDI)?(?????????? Fusion Middleware?????? ?? ?)?????????????????Java EE 6????????CDI???????DI(Dependency Injection)?Java EE 5????????????????????CDI??DI????????????????????????????????????????????????????????CDI????????????????????(?????? Fusion Middleware?????? ??? ??) CDI?? ???????CDI???Java EE 6???????JSR299: Contexts Dependency Injection????? ?????Dependency Injection (??????)?Aspect-Oriented Programming (AOP)?Interception ??????????????????????????? CDI?????????????????????????????????????????????? ?????????????????????????????????????????? ?????????????????????????????????????????????? ???????????????????????????CDI?????????????? CDI?????????????2? ??1???CDI??????????Oracle WebLogic Server 12c????Java EE 6????????? ?????????????????2???beans.xml???????Web??????????WEB-INF/beans.xml? EJB??META-INF/beans.xml????????????CDI????????????????beans.xml???? ?????????????????????? Java EE 5?DI(Dependency Injection) Java EE 5??DI????????????????????????????????????? ?????????????????????????????????????????(@EJB? @Resource?@WebServiceRef)??? Java EE 6?CDI Java EE 6?CDI?????????????????@Inject???????????????? ???????????????????????????????????????????????????? @Qualifier????????????????? ?????????????????????????????????????????@Qualifier? ????????????·??????????????????????@JPN??????????? @Produce???????? ???????????????????? ????????·?????????????? CDI?????????????????????????????????·??????? ????????????????????????????????????????????? ???????????????? EL(Expression Language) ???????? EL????????????JSF?ManagedBean?????????????·?????????????? ??? Java EE 6?????????CDI???????????Java EE 5?DI????AOP??? ???????????????????DI, AOP???????????????? ?????????????CDI?????????????????????????????? ?????CDI?????????????????????????????????? ?????? WebLogic Server??? WebLogic Server?????????WebLogic Server?????! WebLogic Server??????(???????????) WebLogic Server???????? WebLogic Server??????

    Read the article

1