Update of /var/cvs/src/org/mmbase/util
In directory james.mmbase.org:/tmp/cvs-serv5113
Modified Files:
ThreadPools.java
Log Message:
only log if something interesing to say
See also: http://cvs.mmbase.org/viewcvs/src/org/mmbase/util
Index: ThreadPools.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/util/ThreadPools.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- ThreadPools.java 23 Aug 2008 18:56:31 -0000 1.18
+++ ThreadPools.java 3 Sep 2008 19:38:39 -0000 1.19
@@ -18,7 +18,7 @@
*
* @since MMBase 1.8
* @author Michiel Meeuwissen
- * @version $Id: ThreadPools.java,v 1.18 2008/08/23 18:56:31 michiel Exp $
+ * @version $Id: ThreadPools.java,v 1.19 2008/09/03 19:38:39 michiel Exp $
*/
public abstract class ThreadPools {
private static final Logger log =
Logging.getLoggerInstance(ThreadPools.class);
@@ -112,19 +112,28 @@
Map<String,String> props = properties.getProperties();
String max = props.get("jobs.maxsize");
if (max != null) {
- log.info("Setting max pool size from " + ((ThreadPoolExecutor)
jobsExecutor).getMaximumPoolSize() + " to " + max);
- ((ThreadPoolExecutor)
jobsExecutor).setMaximumPoolSize(Integer.parseInt(max));
+ int newSize = Integer.parseInt(max);
+ if (((ThreadPoolExecutor) jobsExecutor).getMaximumPoolSize() !=
newSize) {
+ log.info("Setting max pool size from " + ((ThreadPoolExecutor)
jobsExecutor).getMaximumPoolSize() + " to " + newSize);
+ ((ThreadPoolExecutor)
jobsExecutor).setMaximumPoolSize(newSize);
+ }
}
String core = props.get("jobs.coresize");
if (core != null) {
- log.info("Setting core pool size from " + ((ThreadPoolExecutor)
jobsExecutor).getCorePoolSize() + " to " + core);
- ((ThreadPoolExecutor)
jobsExecutor).setCorePoolSize(Integer.parseInt(core));
+ int newSize = Integer.parseInt(core);
+ if (((ThreadPoolExecutor) jobsExecutor).getCorePoolSize() !=
newSize) {
+ log.info("Setting core pool size from " +
((ThreadPoolExecutor) jobsExecutor).getCorePoolSize() + " to " + newSize);
+ ((ThreadPoolExecutor) jobsExecutor).setCorePoolSize(newSize);
+ }
}
String schedSize = props.get("scheduler.coresize");
if (schedSize != null) {
+ int newSize = Integer.parseInt(schedSize);
+ if (((ThreadPoolExecutor) scheduler).getCorePoolSize() != newSize)
{
log.info("Setting scheduler pool size from " +
((ThreadPoolExecutor) scheduler).getCorePoolSize() + " to " + schedSize);
- ((ThreadPoolExecutor)
scheduler).setCorePoolSize(Integer.parseInt(schedSize));
+ ((ThreadPoolExecutor) scheduler).setCorePoolSize(newSize);
+ }
}
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs