archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marti...@apache.org
Subject [archiva-redback-components-spring-quartz] 34/46: use TriggerBuilder
Date Mon, 09 Apr 2018 20:09:56 GMT
This is an automated email from the ASF dual-hosted git repository.

martin_s pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/archiva-redback-components-spring-quartz.git

commit 7c9ecfadb44031673e0f9cb5cb40585f97d404e0
Author: Olivier Lamy <olamy@apache.org>
AuthorDate: Fri Nov 29 00:08:37 2013 +0000

    use TriggerBuilder
    
    git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-components/trunk@1546482
13f79535-47bb-0310-9956-ffa450edef68
---
 .../redback/components/scheduler/CronExpressionValidator.java | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/archiva/redback/components/scheduler/CronExpressionValidator.java
b/src/main/java/org/apache/archiva/redback/components/scheduler/CronExpressionValidator.java
index e57ee8f..acea7da 100644
--- a/src/main/java/org/apache/archiva/redback/components/scheduler/CronExpressionValidator.java
+++ b/src/main/java/org/apache/archiva/redback/components/scheduler/CronExpressionValidator.java
@@ -20,8 +20,9 @@ package org.apache.archiva.redback.components.scheduler;
  */
 
 import org.apache.commons.lang.StringUtils;
+import org.quartz.CronScheduleBuilder;
 import org.quartz.CronTrigger;
-import org.quartz.impl.triggers.CronTriggerImpl;
+import org.quartz.TriggerBuilder;
 import org.springframework.stereotype.Service;
 
 import java.text.ParseException;
@@ -55,9 +56,11 @@ public final class CronExpressionValidator
                 return false;
             }
 
-            CronTriggerImpl cronTrigger = new CronTriggerImpl();
+            CronTrigger cronTrigger = TriggerBuilder.newTrigger()
+                .withSchedule( CronScheduleBuilder.cronSchedule( cronExpression ) )
+                .build();
+
 
-            cronTrigger.setCronExpression( cronExpression );
 
             if ( cronParams[3].equals( "?" ) || cronParams[5].equals( "?" ) )
             {
@@ -113,7 +116,7 @@ public final class CronExpressionValidator
                 return false;
             }
         }
-        catch ( ParseException e )
+        catch ( RuntimeException e )
         {
             return false;
         }

-- 
To stop receiving notification emails like this one, please contact
martin_s@apache.org.

Mime
View raw message