"avzak" wrote :
| Am i missing something here?
|
No , I looked at the code which displays the Min/Max pool size , here is it
public int getMinimumPoolSize()
| {
| return executor.getCorePoolSize();
| }
|
| public void setMinimumPoolSize(int size)
| {
| synchronized (executor)
| {
| // Don't let the min size > max size
| if (executor.getMaximumPoolSize() < size)
| {
| executor.setCorePoolSize(size);
| executor.setMaximumPoolSize(size);
| }
| }
| }
|
| public int getMaximumPoolSize()
| {
| return executor.getMaximumPoolSize();
| }
|
| public void setMaximumPoolSize(int size)
| {
| synchronized (executor)
| {
| executor.setCorePoolSize(size);
| executor.setMaximumPoolSize(size);
| }
| }
http://anonsvn.jboss.org/repos/common/common-core/trunk/src/main/java/org...
In the above core you will see calling the setMaximumPoolSize() sets
executor.setCorePoolSize(size) and the getMinPoolSize() displays the corePoolSize .
Actaully in setMaximumPoolSize(..) the executor.setCorePoolSize(size); should be
set only if the size(max size)<getMinimumPoolSize().
Even in older version of the ThreadPool I see the similar implementation
| public void setMaximumPoolSize(int size)
| {
| synchronized (executor)
| {
| executor.setMinimumPoolSize(size);
| executor.setMaximumPoolSize(size);
| // Don't let the min size > max size
| if (executor.getKeepAliveSize() > size)
| executor.setKeepAliveSize(size);
| }
| }
http://anonsvn.jboss.org/repos/common/common-core/tags/2.0.0/src/main/jav...
A quicker solution would be to have the custom ThreadPool Implementation which would take
care of min/max pool count, you can simply take the jboss code and introduce the check as
I have explained earlier .
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115646#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...