jsr343-experts@jms-spec.java.net

[jsr343-experts] Re: (JMS_SPEC-63) Introduce concept of platform default JMS connection factory in Java EE

From: Nigel Deakin <nigel.deakin_at_oracle.com>
Date: Fri, 23 Mar 2012 10:11:11 +0000

For information, the Java EE 7 platform expert group has now resolved to require there to be a "default platform JMS
connection factory" in a well-known location in JNDI. Details below.

In summary, Java EE 7 applications can write:

@Resource(lookup="java:comp/defaultJMSConnectionFactory")
ConnectionFactory cf;

and be confident that it will connect to the platform default JMS provider.

Nigel

-------- Original Message --------
Subject: [javaee-spec users] [jsr342-experts] Platform default data source and JMS connection factory
Date: Thu, 22 Mar 2012 15:23:57 -0700
From: Linda DeMichiel <linda.demichiel_at_oracle.com>
Reply-To: jsr342-experts_at_javaee-spec.java.net
Organisation: Oracle Corporation
To: jsr342-experts_at_javaee-spec.java.net

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