users@javaee-spec.java.net

[javaee-spec users] [jsr342-experts] Re: Platform default data source and JMS connection factory

From: Werner Keil <werner.keil_at_gmail.com>
Date: Fri, 23 Mar 2012 00:04:39 +0100

Linda/all,

Thanks, that sounds like the most flexible approach. While not confusing
those who are fine with the default lookup, others who may require
alternatives there can overwrite it.

Nice,
Werner

On Thu, Mar 22, 2012 at 11:23 PM, Linda DeMichiel <
linda.demichiel_at_oracle.com> wrote:

> In view of the feedback we've received on this issue, our conclusion is
> that we should adopt approach 3.
>
> To summarize, in the data source case, the following will apply:
>
> The Java EE Platform requires that a Java EE Product Provider
> provide a database in the operational environment. The Java EE
> Product Provider must also provide a preconfigured, default data
> source for use by the application in accessing this database.
>
> The Java EE Product Provider must make the default data source
> accessible to the application under the JNDI name
> java:comp/defaultDataSource.
>
> The Application Component Provider or Deployer may explicitly bind a
> DataSource resource reference to the default data source using the
> lookup element of the Resource annotation or the lookup-name element
> of the resource-ref deployment descriptor element. For example,
>
> @Resource(name="myDataSource", lookup="java:comp/**defaultDataSource")
> DataSource myDS;
>
> If a DataSource resource reference is not mapped to a specific data
> source by the Application Component Provider or Deployer, it must be
> mapped by the Java EE Product Provider to a preconfigured data source
> for the Java EE Product Provider's default database. For example, in
> the absence of any action on the part of the developer or deployer,
> the following will map to a preconfigured data source for the
> product's default database:
>
> @Resource(name="myDataSource")
> DataSource myDS;
>
>
> And similarly for default JMS Connection Factory, whose JNDI name is
> java:comp/**defaultJMSConnectionFactory.
>
>
> -Linda
>
>
>


-- 
 Werner Keil | JCP Executive Committee Member | Eclipse UOMo Lead
 Twitter @wernerkeil | #Java_Social | #EclipseUOMo | #OpenDDR
Skype werner.keil | Google+ gplus.to/wernerkeil
* TUGDK: Mar 29 2012, Copenhagen, Denmark. Werner Keil, JCP EC Member,
Java Social
Co-Spec Lead will talk about "Social Media"
* geecon: May 16 2012, PoznaƄ, Poland. Werner Keil, JCP EC Member, Social
JSR Co-Spec Lead will present "Java EE 7"
* JustJava: May 19-20 2012, Sao Paulo, Brazil. Werner Keil, JCP EC
Member, Social
JSR Co-Spec Lead will present "Java Social"
* Dutch Mobile Conference: June 7-9 2012, Amsterdam, Netherlands. Werner
Keil, JCP EC (ME) Member, OpenDDR Evangelist will present "OpenDDR"