incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r891680 - in /sling/trunk/bundles/commons/scheduler: pom.xml src/main/java/org/apache/sling/commons/scheduler/impl/QuartzScheduler.java
Date Thu, 17 Dec 2009 12:51:03 GMT
Author: cziegeler
Date: Thu Dec 17 12:50:57 2009
New Revision: 891680

URL: http://svn.apache.org/viewvc?rev=891680&view=rev
Log:
SLING-1248 : Use new commons threads

Modified:
    sling/trunk/bundles/commons/scheduler/pom.xml
    sling/trunk/bundles/commons/scheduler/src/main/java/org/apache/sling/commons/scheduler/impl/QuartzScheduler.java

Modified: sling/trunk/bundles/commons/scheduler/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/scheduler/pom.xml?rev=891680&r1=891679&r2=891680&view=diff
==============================================================================
--- sling/trunk/bundles/commons/scheduler/pom.xml (original)
+++ sling/trunk/bundles/commons/scheduler/pom.xml Thu Dec 17 12:50:57 2009
@@ -29,7 +29,7 @@
 
     <artifactId>org.apache.sling.commons.scheduler</artifactId>
     <packaging>bundle</packaging>
-    <version>2.1.1-SNAPSHOT</version>
+    <version>2.2.0-SNAPSHOT</version>
 
     <name>Apache Sling Scheduler Support</name>
     <description>
@@ -55,10 +55,10 @@
                 <configuration>
                     <instructions>
                         <Import-Package>
-                          org.apache.commons.collections,*
+                            org.apache.commons.collections,*
                         </Import-Package>
                         <Export-Package>
-                            org.apache.sling.commons.scheduler;version=${pom.version}
+                            org.apache.sling.commons.scheduler;version=2.1.0
                         </Export-Package>
                         <Private-Package>
                             org.apache.sling.commons.scheduler.impl,
@@ -111,7 +111,8 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.commons.threads</artifactId>
-            <version>2.0.2-incubator</version>
+            <version>3.0.0-SNAPSHOT</version>
+            <scope>provided</scope>
         </dependency>
         <!-- The following dependencies will be replaced by using the quartz wrapper bundle
-->
         <dependency>

Modified: sling/trunk/bundles/commons/scheduler/src/main/java/org/apache/sling/commons/scheduler/impl/QuartzScheduler.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/scheduler/src/main/java/org/apache/sling/commons/scheduler/impl/QuartzScheduler.java?rev=891680&r1=891679&r2=891680&view=diff
==============================================================================
--- sling/trunk/bundles/commons/scheduler/src/main/java/org/apache/sling/commons/scheduler/impl/QuartzScheduler.java
(original)
+++ sling/trunk/bundles/commons/scheduler/src/main/java/org/apache/sling/commons/scheduler/impl/QuartzScheduler.java
Thu Dec 17 12:50:57 2009
@@ -61,8 +61,6 @@
 
     protected static final String DEFAULT_QUARTZ_JOB_GROUP = "Sling";
 
-    protected static final String THREAD_POOL_NAME = "SLING_SCHEDULER";
-
     protected static final String PREFIX = "Apache Sling Quartz Scheduler ";
 
     protected static final String QUARTZ_SCHEDULER_NAME = "ApacheSling";
@@ -94,6 +92,8 @@
     /** @scr.reference */
     protected ThreadPoolManager threadPoolManager;
 
+    protected ThreadPool threadPool;
+
     /**
      * Activate this component.
      * Start the scheduler.
@@ -147,8 +147,8 @@
             s = factory.getScheduler();
         } else {
             // create the pool
-            final ThreadPool pool = tpm.get(THREAD_POOL_NAME);
-            final QuartzThreadPool quartzPool = new QuartzThreadPool(pool);
+            this.threadPool = tpm.get(null);
+            final QuartzThreadPool quartzPool = new QuartzThreadPool(this.threadPool);
 
             final DirectSchedulerFactory factory = DirectSchedulerFactory.getInstance();
             // unique run id
@@ -181,6 +181,11 @@
      * @param s The scheduler.
      */
     protected void dispose(final org.quartz.Scheduler s) {
+        final ThreadPoolManager tpm = this.threadPoolManager;
+        if ( tpm != null && this.threadPool != null ) {
+            tpm.release(this.threadPool);
+            this.threadPool = null;
+        }
         if ( s != null ) {
             try {
                 s.shutdown();



Mime
View raw message