Author: cziegeler
Date: Tue Oct 26 13:58:08 2010
New Revision: 1027563

URL: http://svn.apache.org/viewvc?rev=1027563&view=rev
Log:
It's enough to just configure the min pool size

Modified:
    
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/EventingThreadPool.java
    
sling/trunk/bundles/extensions/event/src/main/resources/OSGI-INF/metatype/metatype.properties

Modified: 
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/EventingThreadPool.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/EventingThreadPool.java?rev=1027563&r1=1027562&r2=1027563&view=diff
==============================================================================
--- 
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/EventingThreadPool.java
 (original)
+++ 
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/EventingThreadPool.java
 Tue Oct 26 13:58:08 2010
@@ -47,13 +47,10 @@ public class EventingThreadPool implemen
     /** The real thread pool used. */
     private org.apache.sling.commons.threads.ThreadPool threadPool;
 
-    private static final int DEFAULT_MIN_POOL_SIZE = 35; // this is sufficient 
for all threads + approx 25 job queues
-    private static final int DEFAULT_MAX_POOL_SIZE = 50;
+    private static final int DEFAULT_POOL_SIZE = 35;
 
-    @Property(intValue=DEFAULT_MIN_POOL_SIZE)
-    private static final String PROPERTY_MIN_POOL_SIZE = "minPoolSize";
-    @Property(intValue=DEFAULT_MAX_POOL_SIZE)
-    private static final String PROPERTY_MAX_POOL_SIZE = "maxPoolSize";
+    @Property(intValue=DEFAULT_POOL_SIZE)
+    private static final String PROPERTY_POOL_SIZE = "minPoolSize";
 
     @Property(value="NORM",
             option...@propertyoption(name="NORM",value="Norm"),
@@ -67,8 +64,8 @@ public class EventingThreadPool implemen
      */
     protected void activate(final ComponentContext ctx) {
         final ModifiableThreadPoolConfig config = new 
ModifiableThreadPoolConfig();
-        
config.setMinPoolSize(OsgiUtil.toInteger(ctx.getProperties().get(PROPERTY_MIN_POOL_SIZE),
 DEFAULT_MIN_POOL_SIZE));
-        
config.setMaxPoolSize(OsgiUtil.toInteger(ctx.getProperties().get(PROPERTY_MAX_POOL_SIZE),
 DEFAULT_MAX_POOL_SIZE));
+        
config.setMinPoolSize(OsgiUtil.toInteger(ctx.getProperties().get(PROPERTY_POOL_SIZE),
 DEFAULT_POOL_SIZE));
+        config.setMaxPoolSize(config.getMinPoolSize());
         config.setQueueSize(-1); // unlimited
         config.setShutdownGraceful(true);
         
config.setPriority(ThreadPriority.valueOf(OsgiUtil.toString(ctx.getProperties().get(PROPERTY_PRIORITY),
 "NORM")));

Modified: 
sling/trunk/bundles/extensions/event/src/main/resources/OSGI-INF/metatype/metatype.properties
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/resources/OSGI-INF/metatype/metatype.properties?rev=1027563&r1=1027562&r2=1027563&view=diff
==============================================================================
--- 
sling/trunk/bundles/extensions/event/src/main/resources/OSGI-INF/metatype/metatype.properties
 (original)
+++ 
sling/trunk/bundles/extensions/event/src/main/resources/OSGI-INF/metatype/metatype.properties
 Tue Oct 26 13:58:08 2010
@@ -152,13 +152,9 @@ event.pool.description = This is the thr
  possible to limit the maximum number of parallel processed jobs - regardless 
of the queue \
  configuration.
 
-minPoolSize.name = Min Pool Size
-minPoolSize.description = The minimum pool size. The minimum pool size should 
be \
- higher than 10.
-
-maxPoolSize.name = Max Pool Size
-maxPoolSize.description = The maximum pool size. The maximum pool size should 
be higher than \
- or equal to the minimum pool size.
+minPoolSize.name = Pool Size
+minPoolSize.description = The size of the thread pool. This pool is used to 
execute jobs and therefore \
+ limits the maximum number of jobs executed in parallel.
 
 priority.name = Priority
 priority.description = The priority for the threads from this pool. Default is 
norm.


Reply via email to