[jboss-dev-forums] [Design the new POJO MicroContainer] - Declaration and deployment of threads and thread pools in th

david.lloyd@jboss.com do-not-reply at jboss.com
Wed Nov 5 14:49:24 EST 2008


I've developed an experimental POJO-based deployer for defining thread groups, thread factories, and thread pools for the MC.  The source is in my sandbox area at https://svn.jboss.org/repos/sandbox/david.lloyd/jboss-threads/trunk.

Basically it lets you write a jboss-threads.xml file which contains declarations like thread-group, thread-factory, thread-pool-executor, etc.  You can configure things like the daemon status, priority, set parent groups, pool sizes (scaled linearly or by CPU count, or both), the queue type and rejection policies for the executor, etc.  These get created as named beans which can be injected using regular POJO deployment stuff.

Since it's just an experiment I didn't go through the mbean stuff to see if every little function is replicated but this should be enough to tell whether it's a good idea or a dumb idea anyway.  At the very least it should make thread pool configuration a lot more uniform, and hopefully simpler for the end-user...

I don't have a build script yet, but you can use your IDE of choice to compile the two modules into a single JAR and deploy it as a deployer.  The XSD for the jboss-threads.xml files is in there too.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4187058#4187058

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4187058



More information about the jboss-dev-forums mailing list