continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r376641 - in /maven/continuum/branches/continuum-1.0.x: ./ continuum-core/ continuum-core/src/main/java/org/apache/maven/continuum/build/settings/ continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ continuum-core/src/main/re...
Date Fri, 10 Feb 2006 11:32:41 GMT
Author: evenisse
Date: Fri Feb 10 03:32:36 2006
New Revision: 376641

URL: http://svn.apache.org/viewcvs?rev=376641&view=rev
Log:
Use plexus-scheduler.

Removed:
    maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumScheduler.java
    maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumSchedulerException.java
    maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/DefaultContinuumScheduler.java
Modified:
    maven/continuum/branches/continuum-1.0.x/continuum-core/pom.xml
    maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/build/settings/DefaultSchedulesActivator.java
    maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumBuildJob.java
    maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumSchedulerConstants.java
    maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/branches/continuum-1.0.x/continuum-web/pom.xml
    maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/java/org/apache/maven/continuum/web/validation/CronExpressionValidator.java
    maven/continuum/branches/continuum-1.0.x/pom.xml

Modified: maven/continuum/branches/continuum-1.0.x/continuum-core/pom.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/branches/continuum-1.0.x/continuum-core/pom.xml?rev=376641&r1=376640&r2=376641&view=diff
==============================================================================
--- maven/continuum/branches/continuum-1.0.x/continuum-core/pom.xml (original)
+++ maven/continuum/branches/continuum-1.0.x/continuum-core/pom.xml Fri Feb 10 03:32:36 2006
@@ -113,8 +113,8 @@
       <artifactId>maven-core</artifactId>
     </dependency>
     <dependency>
-      <groupId>quartz</groupId>
-      <artifactId>quartz</artifactId>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-quartz</artifactId>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>

Modified: maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/build/settings/DefaultSchedulesActivator.java
URL: http://svn.apache.org/viewcvs/maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/build/settings/DefaultSchedulesActivator.java?rev=376641&r1=376640&r2=376641&view=diff
==============================================================================
--- maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/build/settings/DefaultSchedulesActivator.java
(original)
+++ maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/build/settings/DefaultSchedulesActivator.java
Fri Feb 10 03:32:36 2006
@@ -19,17 +19,17 @@
 import org.apache.maven.continuum.Continuum;
 import org.apache.maven.continuum.model.project.Schedule;
 import org.apache.maven.continuum.scheduler.ContinuumBuildJob;
-import org.apache.maven.continuum.scheduler.ContinuumScheduler;
 import org.apache.maven.continuum.scheduler.ContinuumSchedulerConstants;
-import org.apache.maven.continuum.scheduler.ContinuumSchedulerException;
 import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.scheduler.AbstractJob;
+import org.codehaus.plexus.scheduler.Scheduler;
 import org.codehaus.plexus.util.StringUtils;
 import org.quartz.CronTrigger;
 import org.quartz.JobDataMap;
 import org.quartz.JobDetail;
-import org.quartz.Scheduler;
+import org.quartz.SchedulerException;
 
 import java.text.ParseException;
 import java.util.Collection;
@@ -52,7 +52,7 @@
     /**
      * @plexus.requirement
      */
-    private ContinuumScheduler scheduler;
+    private Scheduler scheduler;
 
     //private int delay = 3600;
     private int delay = 1;
@@ -130,13 +130,14 @@
 
         dataMap.put( "continuum", continuum );
 
-        dataMap.put( "logger", getLogger() );
+        dataMap.put( AbstractJob.LOGGER, getLogger() );
 
         dataMap.put( ContinuumSchedulerConstants.SCHEDULE, schedule );
 
         //the name + group makes the job unique
 
-        JobDetail jobDetail = new JobDetail( schedule.getName(), Scheduler.DEFAULT_GROUP,
ContinuumBuildJob.class );
+        JobDetail jobDetail =
+            new JobDetail( schedule.getName(), org.quartz.Scheduler.DEFAULT_GROUP, ContinuumBuildJob.class
);
 
         jobDetail.setJobDataMap( dataMap );
 
@@ -146,7 +147,7 @@
 
         trigger.setName( schedule.getName() );
 
-        trigger.setGroup( Scheduler.DEFAULT_GROUP );
+        trigger.setGroup( org.quartz.Scheduler.DEFAULT_GROUP );
 
         Date startTime = new Date( System.currentTimeMillis() + delay * 1000 );
 
@@ -169,7 +170,7 @@
 
             getLogger().info( trigger.getNextFireTime() + "" );
         }
-        catch ( ContinuumSchedulerException e )
+        catch ( SchedulerException e )
         {
             throw new SchedulesActivationException( "Cannot schedule build job.", e );
         }
@@ -184,12 +185,12 @@
             {
                 getLogger().info( "Stopping active schedule \"" + schedule.getName() + "\"."
);
 
-                scheduler.interruptSchedule( schedule.getName(), Scheduler.DEFAULT_GROUP
);
+                scheduler.interruptSchedule( schedule.getName(), org.quartz.Scheduler.DEFAULT_GROUP
);
             }
 
-            scheduler.unscheduleJob( schedule.getName(), Scheduler.DEFAULT_GROUP );
+            scheduler.unscheduleJob( schedule.getName(), org.quartz.Scheduler.DEFAULT_GROUP
);
         }
-        catch ( ContinuumSchedulerException e )
+        catch ( SchedulerException e )
         {
             throw new SchedulesActivationException( "Cannot unschedule build job \"" + schedule.getName()
+ "\".", e );
         }

Modified: maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumBuildJob.java
URL: http://svn.apache.org/viewcvs/maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumBuildJob.java?rev=376641&r1=376640&r2=376641&view=diff
==============================================================================
--- maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumBuildJob.java
(original)
+++ maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumBuildJob.java
Fri Feb 10 03:32:36 2006
@@ -20,6 +20,7 @@
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.Schedule;
 import org.codehaus.plexus.logging.Logger;
+import org.codehaus.plexus.scheduler.AbstractJob;
 import org.quartz.InterruptableJob;
 import org.quartz.JobDetail;
 import org.quartz.JobExecutionContext;
@@ -30,13 +31,11 @@
  * @version $Id$
  */
 public class ContinuumBuildJob
-    implements InterruptableJob
+    extends AbstractJob
 {
-    private boolean interrupted;
-
     public void execute( JobExecutionContext context )
     {
-        if ( interrupted )
+        if ( isInterrupted() )
         {
             return;
         }
@@ -51,7 +50,7 @@
         // Get data map out of the job detail
         // ----------------------------------------------------------------------
 
-        Logger logger = (Logger) jobDetail.getJobDataMap().get( ContinuumSchedulerConstants.LOGGER
);
+        Logger logger = (Logger) jobDetail.getJobDataMap().get( AbstractJob.LOGGER );
 
         String jobName = jobDetail.getName();
 
@@ -80,11 +79,5 @@
         catch( InterruptedException e )
         {
         }
-    }
-
-    public void interrupt()
-        throws UnableToInterruptJobException
-    {
-        interrupted = true;
     }
 }

Modified: maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumSchedulerConstants.java
URL: http://svn.apache.org/viewcvs/maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumSchedulerConstants.java?rev=376641&r1=376640&r2=376641&view=diff
==============================================================================
--- maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumSchedulerConstants.java
(original)
+++ maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/scheduler/ContinuumSchedulerConstants.java
Fri Feb 10 03:32:36 2006
@@ -48,8 +48,6 @@
     // Keys for JobDataMap
     // ----------------------------------------------------------------------
 
-    public static final String LOGGER = "logger";
-
     public static final String CONTINUUM = "continuum";
 
     public static final String SCHEDULE = "schedule";

Modified: maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/resources/META-INF/plexus/components.xml?rev=376641&r1=376640&r2=376641&view=diff
==============================================================================
--- maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/resources/META-INF/plexus/components.xml
Fri Feb 10 03:32:36 2006
@@ -83,7 +83,7 @@
           <role>org.apache.maven.continuum.store.ContinuumStore</role>
         </requirement>
         <requirement>
-          <role>org.apache.maven.continuum.scheduler.ContinuumScheduler</role>
+          <role>org.codehaus.plexus.scheduler.Scheduler</role>
         </requirement>
       </requirements>
     </component>
@@ -750,8 +750,8 @@
      -->
 
     <component>
-      <role>org.apache.maven.continuum.scheduler.ContinuumScheduler</role>
-      <implementation>org.apache.maven.continuum.scheduler.DefaultContinuumScheduler</implementation>
+      <role>org.codehaus.plexus.scheduler.Scheduler</role>
+      <implementation>org.codehaus.plexus.scheduler.DefaultScheduler</implementation>
       <configuration>
         <properties>
           <property>

Modified: maven/continuum/branches/continuum-1.0.x/continuum-web/pom.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/branches/continuum-1.0.x/continuum-web/pom.xml?rev=376641&r1=376640&r2=376641&view=diff
==============================================================================
--- maven/continuum/branches/continuum-1.0.x/continuum-web/pom.xml (original)
+++ maven/continuum/branches/continuum-1.0.x/continuum-web/pom.xml Fri Feb 10 03:32:36 2006
@@ -48,8 +48,8 @@
       <artifactId>plexus-formica</artifactId>
     </dependency>
     <dependency>
-      <groupId>quartz</groupId>
-      <artifactId>quartz</artifactId>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-quartz</artifactId>
     </dependency>
     <dependency>
       <groupId>servletapi</groupId>

Modified: maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/java/org/apache/maven/continuum/web/validation/CronExpressionValidator.java
URL: http://svn.apache.org/viewcvs/maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/java/org/apache/maven/continuum/web/validation/CronExpressionValidator.java?rev=376641&r1=376640&r2=376641&view=diff
==============================================================================
--- maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/java/org/apache/maven/continuum/web/validation/CronExpressionValidator.java
(original)
+++ maven/continuum/branches/continuum-1.0.x/continuum-web/src/main/java/org/apache/maven/continuum/web/validation/CronExpressionValidator.java
Fri Feb 10 03:32:36 2006
@@ -18,10 +18,6 @@
 
 import org.codehaus.plexus.formica.FormicaException;
 import org.codehaus.plexus.formica.validation.AbstractValidator;
-import org.codehaus.plexus.util.StringUtils;
-import org.quartz.CronTrigger;
-
-import java.text.ParseException;
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
@@ -33,28 +29,9 @@
     public boolean validate( String cronExpression )
         throws FormicaException
     {
-        try
-        {
-            String[] cronParams = StringUtils.split( cronExpression );
-            if ( cronParams.length < 6 || cronParams.length > 7 )
-            {
-                return false;
-            }
-
-            CronTrigger cronTrigger = new CronTrigger();
-
-            cronTrigger.setCronExpression( cronExpression );
-
-            if ( cronParams[3].equals( "?" ) || cronParams[5].equals( "?" ) )
-            {
-                return true;
-            }
+        org.codehaus.plexus.scheduler.CronExpressionValidator validator =
+            new org.codehaus.plexus.scheduler.CronExpressionValidator();
 
-            return false;
-        }
-        catch ( ParseException e )
-        {
-            return false;
-        }
+        return validator.validate( cronExpression );
     }
 }

Modified: maven/continuum/branches/continuum-1.0.x/pom.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/branches/continuum-1.0.x/pom.xml?rev=376641&r1=376640&r2=376641&view=diff
==============================================================================
--- maven/continuum/branches/continuum-1.0.x/pom.xml (original)
+++ maven/continuum/branches/continuum-1.0.x/pom.xml Fri Feb 10 03:32:36 2006
@@ -406,9 +406,9 @@
         <version>1.7.3.3</version>
       </dependency>
       <dependency>
-        <groupId>quartz</groupId>
-        <artifactId>quartz</artifactId>
-        <version>1.4.5</version>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-quartz</artifactId>
+        <version>1.0-alpha-2-SNAPSHOT</version>
       </dependency>
       <dependency>
         <groupId>org.codehaus.plexus</groupId>



Mime
View raw message