users@javaee-spec.java.net

[javaee-spec users] Re: [jsr366-experts] Re: class-level resource annotations

From: Anatole Tresch <atsticks_at_gmail.com>
Date: Wed, 18 Feb 2015 22:09:46 +0100



Hi,

sorry I am only from time to time reading mails here, so sorry for any
dely. I also would clearly vote for *D* in all cases, but with some
opt-int/config mechanism in place. E.g. adding an additional annotation
or deployment config entry, where I can tell the container to consider
external libraries as well and which packages should be scanned
additionally.

Bye
Anatole




>
>> 2015-01-23 20:51 GMT+01:00 Bill Shannon <bill.shannon_at_oracle.com
>> <mailto:bill.shannon_at_oracle.com>>:
>>
>>
>> We only got one response to this message. Many of you probably
>> never got
>> back to this after the holidays, but now's the time. If we don't
>> hear from
>> you we'll assume your position is "we trust you, Oracle, to do
>> what's best".
>>
>> But really, we'd rather hear from you directly.
>>
>> Thanks.
>>
>> Bill Shannon wrote on 12/08/14 15:25:
>> > I'd like to clarify some of the requirements around resource
>> annotations.
>> >
>> > There's two kinds of resource annotations that can be applied to
>> a class:
>> >
>> > 1. Resource reference annotations such as @Resource. This is
>> probably
>> > rarely used (as opposed to injection), but can be useful in
>> cases where
>> > dynamic lookup of the resource is required.
>> >
>> > @Resource(name = "myDS", lookup =
>> "java:app/application-database")
>> > public class Something {
>> > public void someMethod() {
>> > ...
>> > InitialContext ic = new InitialContext();
>> > DataSource ds = (DataSource)ic.lookup("myDS");
>> > }
>> > }
>> >
>> > 2. Resource definition annotations such as @DataSourceDefinition.
>> >
>> > @DataSourceDefinition(
>> > name = "java:app/applicaiton-database",
>> > className="org.apache.derby.jdbc.ClientDataSource",
>> > url="jdbc:derby://localhost:1527/myDB;user=bill",
>> > databaseName="testDB",
>> > serverName="luckydog"
>> > )
>> > public class SomeOtherClass {
>> > ...
>> > }
>> >
>> > I have some questions that I'd like each of you to answer:
>> >
>> > For Java EE implementors:
>> >
>> > In your implementation, what classes may contain each of these
>> > types of annotations?
>> >
>> > A. A limited set of container-managed classes.
>> > B. Any class that also supports injection (table EE-5.1).
>> > C. Any class in the application package (ear/war/jar file).
>> > D. Any class in the application package or referenced as an
>> > external library.
>> > E. Other. (Explain)
>> >
>> >
>> > For Java EE developers:
>> >
>> > What classes do you expect may contain each of these types of
>> annotations?
>> >
>> > A. A limited set of container-managed classes.
>> > B. Any class that also supports injection (table EE-5.1).
>> > C. Any class in the application package (ear/war/jar file).
>> > D. Any class in the application package or referenced as an
>> > external library.
>> > E. Other. (Explain)
>> >
>> >
>> >
>> > For everyone:
>> >
>> > What classes do you think the Java EE 7 spec requires must be
>> able
>> > to contain each of these types of annotations?
>> >
>> > A. A limited set of container-managed classes.
>> > B. Any class that also supports injection (table EE-5.1).
>> > C. Any class in the application package (ear/war/jar file).
>> > D. Any class in the application package or referenced as an
>> > external library.
>> > E. Other. (Explain)
>> > F. I don't know.
>> >
>> >
>> > Thanks.
>>
>>
>>
>>
>> --
>> *Anatole Tresch*
>> Java Engineer & Architect, JSR Spec Lead
>> Glärnischweg 10
>> CH - 8620 Wetzikon
>>
>> /Switzerland, Europe Zurich, GMT+1/
>> /Twitter: @atsticks/
>> /Blogs: //http://javaremarkables.blogspot.ch//
>> /Google: atsticks
>> Mobile +41-76 344 62 79/
>>
>


-- 
*Anatole Tresch*
Java Engineer & Architect, JSR Spec Lead
Glärnischweg 10
CH - 8620 Wetzikon
*Switzerland, Europe Zurich, GMT+1*
*Twitter:  @atsticks*
*Blogs: **http://javaremarkables.blogspot.ch/
<http://javaremarkables.blogspot.ch/>*
*Google: atsticksMobile  +41-76 344 62 79*