users@glassfish.java.net

Re: access glassfish thread pool

From: Laird Nelson <ljnelson_at_gmail.com>
Date: Fri, 28 Sep 2012 11:57:11 -0700

On Fri, Sep 28, 2012 at 11:41 AM, Ancoron Luciferis <
ancoron.luciferis_at_googlemail.com> wrote:

> Well, that implementation is basically unnecessary and effectively the
> same as using your own EJB for doing the work.
>

Unless I'm missing something, you would inject my EJB like this:

@EJB
private AbstractExecutorService aes;


...and then call any AbstractExecutorService method at all you want,
including non-blocking ones (submit, for example, which doesn't block and
doesn't itself create threads). All asynchrony proceeds through the
EJB-permitted @Asynchronous method on my EJB, which in turn uses the
GlassFish threadpool (or the WebLogic threadpool, or the JBoss threadpool,
or whatever threadpool the EJB container has decided to stick behind their
implementation of the @Asynchronous annotation) and which therefore is
tunable via the application server's normal configuration options. I don't
see how this is the same as doing new Thread(runnable).

Best,
Laird

-- 
http://about.me/lairdnelson