You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2004/09/27 15:09:04 UTC

svn commit: rev 47286 - in cocoon/trunk: . lib src/blocks/cron/conf src/blocks/cron/java/org/apache/cocoon/components/cron src/blocks/lucene/lib

Author: cziegeler
Date: Mon Sep 27 06:09:03 2004
New Revision: 47286

Added:
   cocoon/trunk/src/blocks/lucene/lib/lucene-1.4.1.jar   (contents, props changed)
Removed:
   cocoon/trunk/src/blocks/lucene/lib/lucene-1.4-final.jar
Modified:
   cocoon/trunk/lib/jars.xml
   cocoon/trunk/src/blocks/cron/conf/cron.xconf
   cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobExecutor.java
   cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
   cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobStoreCMT.java
   cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobStoreTX.java
   cocoon/trunk/status.xml
Log:
Sync blocks: cron, lucene, midi and repository

Modified: cocoon/trunk/lib/jars.xml
==============================================================================
--- cocoon/trunk/lib/jars.xml	(original)
+++ cocoon/trunk/lib/jars.xml	Mon Sep 27 06:09:03 2004
@@ -585,7 +585,7 @@
       searching of documents.
     </description>
     <used-by>Lucene block</used-by>
-    <lib>lucene/lib/lucene-1.4-final.jar</lib>
+    <lib>lucene/lib/lucene-1.4.1.jar</lib>
     <homepage>http://jakarta.apache.org/lucene/</homepage>
   </file>
 

Modified: cocoon/trunk/src/blocks/cron/conf/cron.xconf
==============================================================================
--- cocoon/trunk/src/blocks/cron/conf/cron.xconf	(original)
+++ cocoon/trunk/src/blocks/cron/conf/cron.xconf	Mon Sep 27 06:09:03 2004
@@ -14,67 +14,107 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
-
 <xconf xpath="/cocoon" unless="component[@role='org.apache.cocoon.components.cron.JobScheduler']">
 
     <component role="org.apache.cocoon.components.cron.JobScheduler"
                class="org.apache.cocoon.components.cron.QuartzJobScheduler"
                logger="cron">
-        <!-- Definitions for a thread pool used to schedule jobs -->
+      <!--+
+          | Definitions for a thread pool used to schedule jobs
+          +-->
         <thread-pool>
-            <!-- Should we queue up execution requests if the pool is busy? Defaults to false -->
+        <!--+
+            | Should we queue up execution requests if the pool is busy?
+            | Defaults to false
+            +-->
             <use-queueing>false</use-queueing>
-            <!-- How big should the queue be. Defaults to unlimited size (<0 == default) -->
+
+        <!--+
+            | How big should the queue be.
+            | Defaults to unlimited size (<0 == default)
+            +-->
             <queue-size>-1</queue-size>
-            <!-- The maximum size of the pool. Defaults to Integer.MAX_VALUE (<0 == default) -->
+
+        <!--+
+            | The maximum size of the pool.
+            | Defaults to Integer.MAX_VALUE (<0 == default)
+            +-->
             <max-pool-size>-1</max-pool-size>
-            <!-- The minimum size of the pool.Defaults to 1 (<0 == default) -->
+
+        <!--+
+            | The minimum size of the pool.
+            | Defaults to 1 (<0 == default)
+            +-->
             <min-pool-size>1</min-pool-size>
-            <!-- How long will an idle thread be kept before it will be discarded. 
-                 Defaults to 60000ms (<0 == default) -->
+
+        <!--+
+            | How long will an idle thread be kept before it will be discarded.
+            | Defaults to 60000ms (<0 == default)
+            +-->
             <keep-alive-time-ms>60000</keep-alive-time-ms>
-            <!-- Which blocking policy should be used if the maximum pool size and queue size is bounded:
-                 Run:           (default) The thread making the execute request runs the task itself. 
-                                This policy helps guard against lockup. 
-                 Wait:          Wait until a thread becomes available. 
-                 Abort:         Throw a RuntimeException 
-                 Discard:       Throw away the current request and return. 
-                 DiscardOldest: Throw away the oldest request and return. -->
+
+        <!--+
+            | Which blocking policy should be used if the maximum pool
+            | size and queue size is bounded:
+            | Run:           (default) The thread making the execute
+            |                request runs the task itself. This policy
+            |                helps guard against lockup.
+            | Wait:          Wait until a thread becomes available.
+            | Abort:         Throw a RuntimeException
+            | Discard:       Throw away the current request and return.
+            | DiscardOldest: Throw away the oldest request and return.
+            +-->
             <block-policy>RUN</block-policy>
-            <!-- Should queued and running jobs be given a chance to finished on system shutdown. Defaults to true -->
+
+        <!--+
+            | Should queued and running jobs be given a chance to finished
+            | on system shutdown. Defaults to true
+            +-->
             <shutdown-graceful>true</shutdown-graceful>
-            <!-- The maximum time to wait for running jobs to complete. Defaults to unlimited time (<0 == default) -->
+
+        <!--+
+            | The maximum time to wait for running jobs to complete.
+            | Defaults to unlimited time (<0 == default)
+            +-->
             <shutdown-wait-time-ms>5000</shutdown-wait-time-ms>
         </thread-pool>
-        <!-- Definition of the JobStore -->
-        <!-- store type is one of "ram" (default), "tx", or "cmt" -->
-        <store type="ram"/>
-        <!--
-        <store type="tx">
-          <datasource>jdbc/MyJobStoreDS</datasource>
+
+      <!--+
+          | Definition of the JobStore.
+          | Store type can be one of "ram" (default), "tx", or "cmt".
+          |
+          | "tx" and "cmt" stores require datasource configuration.
+          | (Attributes delegate and provider are optional)
+      <store type="tx" delegate="org.quartz.impl.jdbcjobstore.StdJDBCDelegate">
+        <datasource provider="jndi">jdbc/MyJobStoreDS</datasource>
         </store>
-        -->
+          +-->
+      <store type="ram"/>
+
         <!-- Definintions of triggers -->
         <triggers>
-            <!-- Sample definition of a trigger -->
-            <!-- A trigger element has the following attributes:
-                    name:            A name for the trigger. Mandatory
-                    target:          A role name to lookup the job object in the ServiceManager. Mandatory
-                    concurrent-runs: Is it allowed to reschedule a job even if the previous one is
-                                     still running. Optionl, defaults to true.
-                 A trigger element has the following child elements:
-                    cron: A string expression defining the scheduling timing.
-                          Optional. If not specified the following elements are explored:
-                       seconds:  A string expression for the secods part of a cron expression.
-                       minutes:  A string expression for the secods part of a cron expression.
-                       hours:    A string expression for the secods part of a cron expression.
-                       days:     A string expression for the secods part of a cron expression.
-                       month:    A string expression for the secods part of a cron expression.
-                       weekdays: A string expression for the secods part of a cron expression.
-                       years:    A string expression for the secods part of a cron expression.
-                    For detailed information about the expressions look at the documentation
-            -->
-            <!--
+        <!--+
+            | A trigger element has the following attributes:
+            |    name:            A name for the trigger. Mandatory
+            |    target:          A role name to lookup the job object in the ServiceManager. Mandatory
+            |    concurrent-runs: Is it allowed to reschedule a job even if the previous one is
+            |                     still running. Optionl, defaults to true.
+            | A trigger element has the following child elements:
+            |    cron: A string expression defining the scheduling timing.
+            |          Optional. If not specified the following elements are explored:
+            |       seconds:  Expression for the secods part of a cron expression.
+            |       minutes:  Expression for the minutes part of a cron expression.
+            |       hours:    Expression for the hours part of a cron expression.
+            |       days:     Expression for the days part of a cron expression.
+            |       month:    Expression for the months part of a cron expression.
+            |       weekdays: Expression for the weekdays part of a cron expression.
+            |       years:    Expression for the years part of a cron expression.
+            | For detailed information about the expressions look at the
+            | documentation.
+            +-->
+
+        <!--+
+            | Sample trigger definitions
             <trigger name="test-job1"
                      target="org.apache.cocoon.components.cron.CronJob/test"
                      concurrent-runs="false">
@@ -90,15 +130,15 @@
                 <months>*</months>
                 <weekdays>SUN-FRI</weekdays>
             </trigger>
-			<trigger name="pipeline-test"
-					 target="org.apache.cocoon.components.cron.CronJob/pipeline-test"
-					 concurrent-runs="true">
-				<minutes>0</minutes>
-				<hours>12</hours>
-				<days>?</days>
-				<months>*</months>
-				<weekdays>MON-FRI</weekdays>
-			</trigger>
+	    <trigger name="pipeline-test"
+	         target="org.apache.cocoon.components.cron.CronJob/pipeline-test"
+		 concurrent-runs="true">
+		 <minutes>0</minutes>
+		 <hours>12</hours>
+		 <days>?</days>
+		 <months>*</months>
+		 <weekdays>MON-FRI</weekdays>
+	    </trigger>
             -->
         </triggers>
     </component>

Modified: cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobExecutor.java
==============================================================================
--- cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobExecutor.java	(original)
+++ cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobExecutor.java	Mon Sep 27 06:09:03 2004
@@ -143,8 +143,11 @@
             EnvironmentHelper.leaveProcessor();
             env.finishingProcessing();
 
-            if (release && manager != null) {
-                manager.release(job);
+            if (manager != null) {
+                manager.release(processor);
+                if (release) {
+                    manager.release(job);
+                }
             }
             if (dispose) {
             	ContainerUtil.dispose(job);

Modified: cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
==============================================================================
--- cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java	(original)
+++ cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java	Mon Sep 27 06:09:03 2004
@@ -15,6 +15,12 @@
  */
 package org.apache.cocoon.components.cron;
 
+import java.text.ParseException;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.Map;
+import java.util.NoSuchElementException;
+
 import org.apache.avalon.framework.CascadingException;
 import org.apache.avalon.framework.activity.Disposable;
 import org.apache.avalon.framework.activity.Initializable;
@@ -32,12 +38,6 @@
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.Serviceable;
 import org.apache.avalon.framework.thread.ThreadSafe;
-
-import org.apache.cocoon.Constants;
-
-import EDU.oswego.cs.dl.util.concurrent.BoundedBuffer;
-import EDU.oswego.cs.dl.util.concurrent.LinkedQueue;
-import EDU.oswego.cs.dl.util.concurrent.PooledExecutor;
 import org.quartz.CronTrigger;
 import org.quartz.Job;
 import org.quartz.JobDataMap;
@@ -55,11 +55,9 @@
 import org.quartz.utils.DBConnectionManager;
 import org.quartz.utils.JNDIConnectionProvider;
 
-import java.text.ParseException;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.Map;
-import java.util.NoSuchElementException;
+import EDU.oswego.cs.dl.util.concurrent.BoundedBuffer;
+import EDU.oswego.cs.dl.util.concurrent.LinkedQueue;
+import EDU.oswego.cs.dl.util.concurrent.PooledExecutor;
 
 /**
  * This component can either schedule jobs or directly execute one.

Modified: cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobStoreCMT.java
==============================================================================
--- cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobStoreCMT.java	(original)
+++ cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobStoreCMT.java	Mon Sep 27 06:09:03 2004
@@ -30,9 +30,10 @@
  * @since 2.1.6
  */
 public class QuartzJobStoreCMT extends JobStoreCMT {
-    private Logger logger;
-    private ServiceManager manager;
-    private Context context;
+	
+    private final Logger logger;
+    private final ServiceManager manager;
+    private final Context context;
     private DriverDelegate delegate;
 
     public QuartzJobStoreCMT(Logger logger, ServiceManager manager, Context context) {

Modified: cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobStoreTX.java
==============================================================================
--- cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobStoreTX.java	(original)
+++ cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobStoreTX.java	Mon Sep 27 06:09:03 2004
@@ -30,9 +30,10 @@
  * @since 2.1.6
  */
 public class QuartzJobStoreTX extends JobStoreTX {
-    private Logger logger;
-    private ServiceManager manager;
-    private Context context;
+
+    private final Logger logger;
+    private final ServiceManager manager;
+    private final Context context;
     private DriverDelegate delegate;
 
     public QuartzJobStoreTX(Logger logger, ServiceManager manager, Context context) {

Added: cocoon/trunk/src/blocks/lucene/lib/lucene-1.4.1.jar
==============================================================================
Binary file. No diff available.

Modified: cocoon/trunk/status.xml
==============================================================================
--- cocoon/trunk/status.xml	(original)
+++ cocoon/trunk/status.xml	Mon Sep 27 06:09:03 2004
@@ -336,7 +336,7 @@
      Cron block: Fixed memory leak, QuartzJobExecutor was not releasing pipelines.
    </action>
    <action dev="AG" type="update">
-     Updated jexl to 1.0.
+     Updated jexl to 1.0, lucene to 1.4.1
    </action>
    <action dev="DC" type="add" fixes-bug="30321" due-to="Colin Adams">
      Selector for matching the request headers using a regular expression.
@@ -356,6 +356,9 @@
    </action>
    <action dev="VG" type="update">
      Cron block: Add support for persistent job stores, type "tx" and "cmt".
+   </action>
+   <action dev="VG" type="fix">
+     Cron block: Fix TestCronJob pipeline call functionality.
    </action>
    <action dev="AG" type="update">
      Updated rhino to 1.5r4-20040629T1232,