users@glassfish.java.net

Re: Working queue in Glassfish

From: Sivakumar Thyagarajan <Sivakumar.Thyagarajan_at_Sun.COM>
Date: Fri, 10 Aug 2007 16:30:05 +0530

glassfish_at_javadesktop.org wrote:
> Hi all,
>
> I post here to get some advice.
> I develop an application on Glassfish v2 that needs to perform regularly (as linux cron does) a lot of operations.
> These operations are pretty long, and must be performed by threads.
> So, i would like to manage a thread pool and give the threads the work to do via a WorkManager instantiated via the Quartz framework (which is used to perform scheduled task).
> My question is : Can I use a thread pool created via the Glassfish Admin console ? If I can, how can I call it from my code and pass work to do ?

The thread pool created via the admin console is an ORB thread pool that is
meant to be assigned to J2EE connectors/resource adapters [WorkManager] or the
ORB. This cannot be used externally [in a portable fashion] by applications.

> Or have I to implement my own thread pool and working queue ?

The EJB and the servlet specifications explicitly prohibit an application from
create their own threads/thread-pool within the container. The portable
mechanism would be to use the Work Manager Contract in the J2EE connector
specification or handle such work asy.
http://java.sun.com/j2ee/1.4/docs/api/javax/resource/spi/work/WorkManager.html
http://java.sun.com/developer/technicalArticles/J2EE/connectorarch1_5/
http://www.ibm.com/developerworks/java/library/j-jca2/

Quartz integration could also be done via a resource adapter.
http://www.google.com/search?q=QuartzResourceAdapter

Thanks
--Siva.

> Or have I to implement my own thread pool and working queue ?
> Thanks for your responses
> [Message sent by forum member 'dazzx' (dazzx)]
>
> http://forums.java.net/jive/thread.jspa?messageID=230403
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>