There is already a recommended JNDI namespace and default objects for
JSR 236 objects.
However I can define JMS destinations from within the application as:
@JMSDestinationDefinitions({_at_JMSDestinationDefinition(name =
"java:global/jms/mySyncQueue",
resourceAdapterName = "jmsra",
className = "javax.jms.Queue",
destinationName="syncQueue",
description="My Sync Queue"),
@JMSDestinationDefinition(name = "java:global/jms/myAsyncQueue",
resourceAdapterName = "jmsra",
className = "javax.jms.Queue",
destinationName="asyncQueue",
description="My Async Queue")
})
JSR 919 (JavaMail) is adding MailSessionDefinition and
MailSessionDefinitions with the upcoming MR:
http://kenai.com/projects/javamail/sources/mercurial/content/doc/spec/JavaMail-1.5-changes.txt
Any plans to support to similar annotations to create
ManagedExecutorService, ManagedScheduledExecutorService,
ManagedThreadFactory, and ContextService ?
I'd love to create an application as:
@ManagedExecutorService(name="java:comp/concurrent/myExecutor")
@WebServlet(urlPatterns={ "/myServlet" })
and see the runtime create the appropriate JNDI resource for me.
Similarly for others too.
This will also bring some more alignment with rest of the Java EE 7
platform.
Arun
--
http://twitter.com/arungupta
http://blogs.oracle.com/arungupta