geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dain Sundstrom <>
Subject Re: GBeans threading best practices
Date Wed, 03 Aug 2005 16:34:54 GMT
On Aug 3, 2005, at 8:13 AM, Miguel A Paraz wrote:

> Hi,
> I'm planning on writing my own GBeans to implement services.
> Is it OK to start new Threads - using new Thread() directly, or
> indirectly by using util.concurrent facilities which I see in the
> code?

You can start threads directly, but it is preferrable to use a  
EDU.oswego.cs.dl.util.concurrent.Executor.  The best practice is to  
have the Executor inject via constructor injection or setter  
injection.  This allows a user of your service to have complete  
control the properties of the thread pool.

> Geronimo won't know about them and it's up to the GBean to shut them
> down in doStop().



View raw message