[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Declaration and deployment of threads and thread pools i

adrian@jboss.org do-not-reply at jboss.com
Thu Nov 6 07:41:02 EST 2008


Looks good (but I only gave it a quick scan).
Obviously it needs some tests to avoid regressions. :-)

A few issues:

* THREAD PRIORITY

Why are you using float for thread priority?
A thread can only take an integer priority between 
1 (Thread.MIN_PRIORiTY) and 10 (Thread.MAX_PRIORITY)

Even if it was a decimal, BigDecimal would be better than
float because of the rounding errors.
See for example the xsd:decimal bindings here:
http://www.xyzws.com/scdjws/studyguide/jaxb_samples2.0.html
or look at the jaxb spec for recommended bindings.

* MBEANS

You can inject into MBeans just like you can pojos

* JBoss's BasicThreadPool and Task abstraction

We already have an abstraction in the common-core project
that adds to the basic thread pool executor abstraction.
(Mostly by wrapping it).

This adds things like lifecycle and error handling callbacks via the task abstraction,
and management exposure via an MBean.

But there are also some different policies such as MinThreadPoolExecutor
so you can avoid the known race condition if you implement a WAIT policy
when the thread pool is full (something that is not part of java.util.concurrent
because of the race condition)

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

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



More information about the jboss-dev-forums mailing list