users@glassfish.java.net

ExecutorService: injectable via CDI?

From: <forums_at_java.net>
Date: Tue, 16 Nov 2010 12:14:33 -0800

  From a specification compliance standpoint, could one inject an instance of
java.util.concurrent.ExecutorService inside a stateless EJB?

An EJB is not allowed to manage threads using synchronization primitives,
directly or indirectly.  That means I can't just do new Thread() or just use
one of the values returned by java.util.concurrent.Executors.

But would injecting such an ExecutorService using CDI get me off the hook
here?

Or am I looking at writing a resource adapter to submit work to the
container?

As always, apologies for any double posting that occurs--java.net's forums
occasionally double post my submissions after a significant delay.

Thanks,
Laird


--
[Message sent by forum member 'ljnelson']
View Post: http://forums.java.net/node/718934