mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-08-18 20:38:02 +08:00
7.0.0.M1
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron;
|
||||
package cn.hutool.v7.cron;
|
||||
|
||||
import java.util.TimeZone;
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron;
|
||||
package cn.hutool.v7.cron;
|
||||
|
||||
import org.dromara.hutool.core.exception.HutoolException;
|
||||
import cn.hutool.v7.core.exception.HutoolException;
|
||||
|
||||
/**
|
||||
* 定时任务异常
|
||||
@@ -14,12 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron;
|
||||
package cn.hutool.v7.cron;
|
||||
|
||||
import org.dromara.hutool.core.date.DateUnit;
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import org.dromara.hutool.core.thread.ThreadUtil;
|
||||
import org.dromara.hutool.log.Log;
|
||||
import cn.hutool.v7.core.date.DateUnit;
|
||||
import cn.hutool.v7.core.lang.Console;
|
||||
import cn.hutool.v7.core.thread.ThreadUtil;
|
||||
import cn.hutool.v7.log.Log;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -15,15 +15,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron;
|
||||
package cn.hutool.v7.cron;
|
||||
|
||||
import org.dromara.hutool.core.exception.HutoolException;
|
||||
import org.dromara.hutool.core.io.resource.NoResourceException;
|
||||
import org.dromara.hutool.cron.pattern.CronPattern;
|
||||
import org.dromara.hutool.cron.pattern.parser.PatternParser;
|
||||
import org.dromara.hutool.cron.task.Task;
|
||||
import org.dromara.hutool.setting.Setting;
|
||||
import org.dromara.hutool.setting.SettingException;
|
||||
import cn.hutool.v7.core.exception.HutoolException;
|
||||
import cn.hutool.v7.core.io.resource.NoResourceException;
|
||||
import cn.hutool.v7.cron.pattern.CronPattern;
|
||||
import cn.hutool.v7.cron.pattern.parser.PatternParser;
|
||||
import cn.hutool.v7.cron.task.Task;
|
||||
import cn.hutool.v7.setting.Setting;
|
||||
import cn.hutool.v7.setting.SettingException;
|
||||
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
@@ -14,22 +14,22 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron;
|
||||
package cn.hutool.v7.cron;
|
||||
|
||||
import org.dromara.hutool.core.map.MapUtil;
|
||||
import org.dromara.hutool.core.thread.ExecutorBuilder;
|
||||
import org.dromara.hutool.core.thread.ThreadFactoryBuilder;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.core.data.id.IdUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.cron.listener.TaskListener;
|
||||
import org.dromara.hutool.cron.listener.TaskListenerManager;
|
||||
import org.dromara.hutool.cron.pattern.CronPattern;
|
||||
import org.dromara.hutool.cron.task.InvokeTask;
|
||||
import org.dromara.hutool.cron.task.RunnableTask;
|
||||
import org.dromara.hutool.cron.task.Task;
|
||||
import org.dromara.hutool.log.LogUtil;
|
||||
import org.dromara.hutool.setting.Setting;
|
||||
import cn.hutool.v7.core.map.MapUtil;
|
||||
import cn.hutool.v7.core.thread.ExecutorBuilder;
|
||||
import cn.hutool.v7.core.thread.ThreadFactoryBuilder;
|
||||
import cn.hutool.v7.core.text.CharUtil;
|
||||
import cn.hutool.v7.core.data.id.IdUtil;
|
||||
import cn.hutool.v7.core.text.StrUtil;
|
||||
import cn.hutool.v7.cron.listener.TaskListener;
|
||||
import cn.hutool.v7.cron.listener.TaskListenerManager;
|
||||
import cn.hutool.v7.cron.pattern.CronPattern;
|
||||
import cn.hutool.v7.cron.task.InvokeTask;
|
||||
import cn.hutool.v7.cron.task.RunnableTask;
|
||||
import cn.hutool.v7.cron.task.Task;
|
||||
import cn.hutool.v7.log.LogUtil;
|
||||
import cn.hutool.v7.setting.Setting;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron;
|
||||
package cn.hutool.v7.cron;
|
||||
|
||||
import org.dromara.hutool.cron.task.CronTask;
|
||||
import org.dromara.hutool.cron.task.Task;
|
||||
import cn.hutool.v7.cron.task.CronTask;
|
||||
import cn.hutool.v7.cron.task.Task;
|
||||
|
||||
/**
|
||||
* 作业执行器<br>
|
||||
@@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron;
|
||||
package cn.hutool.v7.cron;
|
||||
|
||||
import org.dromara.hutool.cron.task.CronTask;
|
||||
import org.dromara.hutool.cron.task.Task;
|
||||
import cn.hutool.v7.cron.task.CronTask;
|
||||
import cn.hutool.v7.cron.task.Task;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron;
|
||||
package cn.hutool.v7.cron;
|
||||
|
||||
/**
|
||||
* 作业启动器<br>
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron;
|
||||
package cn.hutool.v7.cron;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
@@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron;
|
||||
package cn.hutool.v7.cron;
|
||||
|
||||
import org.dromara.hutool.core.map.TripleTable;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.cron.pattern.CronPattern;
|
||||
import org.dromara.hutool.cron.task.CronTask;
|
||||
import org.dromara.hutool.cron.task.Task;
|
||||
import cn.hutool.v7.core.map.TripleTable;
|
||||
import cn.hutool.v7.core.text.StrUtil;
|
||||
import cn.hutool.v7.cron.pattern.CronPattern;
|
||||
import cn.hutool.v7.cron.task.CronTask;
|
||||
import cn.hutool.v7.cron.task.Task;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
@@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.listener;
|
||||
package cn.hutool.v7.cron.listener;
|
||||
|
||||
import org.dromara.hutool.cron.TaskExecutor;
|
||||
import cn.hutool.v7.cron.TaskExecutor;
|
||||
|
||||
/**
|
||||
* 简单监听实现,不做任何操作<br>
|
||||
@@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.listener;
|
||||
package cn.hutool.v7.cron.listener;
|
||||
|
||||
import org.dromara.hutool.cron.TaskExecutor;
|
||||
import cn.hutool.v7.cron.TaskExecutor;
|
||||
|
||||
/**
|
||||
* 定时任务监听接口<br>
|
||||
@@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.listener;
|
||||
package cn.hutool.v7.cron.listener;
|
||||
|
||||
import org.dromara.hutool.cron.TaskExecutor;
|
||||
import org.dromara.hutool.log.LogUtil;
|
||||
import cn.hutool.v7.cron.TaskExecutor;
|
||||
import cn.hutool.v7.log.LogUtil;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
@@ -20,4 +20,4 @@
|
||||
* @author Looly
|
||||
*
|
||||
*/
|
||||
package org.dromara.hutool.cron.listener;
|
||||
package cn.hutool.v7.cron.listener;
|
||||
@@ -18,13 +18,13 @@
|
||||
* 定时任务模块,提供类Crontab表达式的定时任务,实现参考了Cron4j,同时可以支持秒级别的定时任务定义和年的定义(同时兼容Crontab、Cron4j、Quartz表达式)<br>
|
||||
* 定时任务模块由三部分组成:
|
||||
* <ul>
|
||||
* <li>{@link org.dromara.hutool.cron.Scheduler} 定时任务调度器,用于整体管理任务的增删、启停和触发运行。</li>
|
||||
* <li>{@link org.dromara.hutool.cron.task.Task} 定时任务实现,用于定义具体的任务</li>
|
||||
* <li>{@link org.dromara.hutool.cron.pattern.CronPattern} 定时任务表达式,用于定义任务触发时间</li>
|
||||
* <li>{@link cn.hutool.v7.cron.Scheduler} 定时任务调度器,用于整体管理任务的增删、启停和触发运行。</li>
|
||||
* <li>{@link cn.hutool.v7.cron.task.Task} 定时任务实现,用于定义具体的任务</li>
|
||||
* <li>{@link cn.hutool.v7.cron.pattern.CronPattern} 定时任务表达式,用于定义任务触发时间</li>
|
||||
* </ul>
|
||||
*
|
||||
* 同时,提供了{@link org.dromara.hutool.cron.CronUtil}工具类,维护一个全局的{@link org.dromara.hutool.cron.Scheduler}。
|
||||
* 同时,提供了{@link cn.hutool.v7.cron.CronUtil}工具类,维护一个全局的{@link cn.hutool.v7.cron.Scheduler}。
|
||||
*
|
||||
* @author Looly
|
||||
*/
|
||||
package org.dromara.hutool.cron;
|
||||
package cn.hutool.v7.cron;
|
||||
@@ -14,12 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.pattern;
|
||||
package cn.hutool.v7.cron.pattern;
|
||||
|
||||
import org.dromara.hutool.core.comparator.CompareUtil;
|
||||
import org.dromara.hutool.core.date.CalendarUtil;
|
||||
import org.dromara.hutool.cron.pattern.matcher.PatternMatcher;
|
||||
import org.dromara.hutool.cron.pattern.parser.PatternParser;
|
||||
import cn.hutool.v7.core.comparator.CompareUtil;
|
||||
import cn.hutool.v7.core.date.CalendarUtil;
|
||||
import cn.hutool.v7.cron.pattern.matcher.PatternMatcher;
|
||||
import cn.hutool.v7.cron.pattern.parser.PatternParser;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
@@ -14,11 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.pattern;
|
||||
package cn.hutool.v7.cron.pattern;
|
||||
|
||||
import org.dromara.hutool.core.date.CalendarUtil;
|
||||
import org.dromara.hutool.core.date.DateUtil;
|
||||
import org.dromara.hutool.core.lang.Assert;
|
||||
import cn.hutool.v7.core.date.CalendarUtil;
|
||||
import cn.hutool.v7.core.date.DateUtil;
|
||||
import cn.hutool.v7.core.lang.Assert;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
@@ -14,12 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.pattern;
|
||||
package cn.hutool.v7.cron.pattern;
|
||||
|
||||
import org.dromara.hutool.core.date.Month;
|
||||
import org.dromara.hutool.core.date.Week;
|
||||
import org.dromara.hutool.core.lang.Assert;
|
||||
import org.dromara.hutool.cron.CronException;
|
||||
import cn.hutool.v7.core.date.Month;
|
||||
import cn.hutool.v7.core.date.Week;
|
||||
import cn.hutool.v7.core.lang.Assert;
|
||||
import cn.hutool.v7.cron.CronException;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.pattern;
|
||||
package cn.hutool.v7.cron.pattern;
|
||||
|
||||
import org.dromara.hutool.core.date.Week;
|
||||
import cn.hutool.v7.core.date.Week;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Calendar;
|
||||
@@ -14,11 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.pattern.builder;
|
||||
package cn.hutool.v7.cron.pattern.builder;
|
||||
|
||||
import org.dromara.hutool.core.collection.CollUtil;
|
||||
import org.dromara.hutool.core.collection.ListUtil;
|
||||
import org.dromara.hutool.core.lang.builder.Builder;
|
||||
import cn.hutool.v7.core.collection.CollUtil;
|
||||
import cn.hutool.v7.core.collection.ListUtil;
|
||||
import cn.hutool.v7.core.lang.builder.Builder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -14,14 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.pattern.builder;
|
||||
package cn.hutool.v7.cron.pattern.builder;
|
||||
|
||||
import org.dromara.hutool.core.lang.Assert;
|
||||
import org.dromara.hutool.core.lang.builder.Builder;
|
||||
import org.dromara.hutool.core.text.StrJoiner;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.util.ObjUtil;
|
||||
import org.dromara.hutool.cron.pattern.Part;
|
||||
import cn.hutool.v7.core.lang.Assert;
|
||||
import cn.hutool.v7.core.lang.builder.Builder;
|
||||
import cn.hutool.v7.core.text.StrJoiner;
|
||||
import cn.hutool.v7.core.text.StrUtil;
|
||||
import cn.hutool.v7.core.util.ObjUtil;
|
||||
import cn.hutool.v7.cron.pattern.Part;
|
||||
|
||||
/**
|
||||
* 定时任务表达式构建器
|
||||
@@ -20,4 +20,4 @@
|
||||
* @author Looly
|
||||
* @since 6.0.0
|
||||
*/
|
||||
package org.dromara.hutool.cron.pattern.builder;
|
||||
package cn.hutool.v7.cron.pattern.builder;
|
||||
@@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.pattern.matcher;
|
||||
package cn.hutool.v7.cron.pattern.matcher;
|
||||
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import cn.hutool.v7.core.text.StrUtil;
|
||||
|
||||
/**
|
||||
* 所有值匹配,始终返回{@code true}
|
||||
@@ -14,11 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.pattern.matcher;
|
||||
package cn.hutool.v7.cron.pattern.matcher;
|
||||
|
||||
import org.dromara.hutool.core.collection.CollUtil;
|
||||
import org.dromara.hutool.core.lang.Assert;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import cn.hutool.v7.core.collection.CollUtil;
|
||||
import cn.hutool.v7.core.lang.Assert;
|
||||
import cn.hutool.v7.core.text.StrUtil;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.pattern.matcher;
|
||||
package cn.hutool.v7.cron.pattern.matcher;
|
||||
|
||||
import org.dromara.hutool.core.date.Month;
|
||||
import cn.hutool.v7.core.date.Month;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.pattern.matcher;
|
||||
package cn.hutool.v7.cron.pattern.matcher;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.pattern.matcher;
|
||||
package cn.hutool.v7.cron.pattern.matcher;
|
||||
|
||||
import org.dromara.hutool.core.date.DateUtil;
|
||||
import org.dromara.hutool.cron.pattern.Part;
|
||||
import cn.hutool.v7.core.date.DateUtil;
|
||||
import cn.hutool.v7.cron.pattern.Part;
|
||||
|
||||
import java.time.Year;
|
||||
import java.util.Arrays;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.pattern.matcher;
|
||||
package cn.hutool.v7.cron.pattern.matcher;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashSet;
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
/**
|
||||
* 定时任务表达式匹配器,内部使用<br>
|
||||
* 单一表达式使用{@link org.dromara.hutool.cron.pattern.matcher.PatternMatcher}表示<br>
|
||||
* {@link org.dromara.hutool.cron.pattern.matcher.PatternMatcher}由7个{@link org.dromara.hutool.cron.pattern.matcher.PartMatcher}组成,
|
||||
* 单一表达式使用{@link cn.hutool.v7.cron.pattern.matcher.PatternMatcher}表示<br>
|
||||
* {@link cn.hutool.v7.cron.pattern.matcher.PatternMatcher}由7个{@link cn.hutool.v7.cron.pattern.matcher.PartMatcher}组成,
|
||||
* 分别表示定时任务表达式中的7个位置:
|
||||
* <pre>
|
||||
* 0 1 2 3 4 5 6
|
||||
@@ -27,4 +27,4 @@
|
||||
* @author Looly
|
||||
*
|
||||
*/
|
||||
package org.dromara.hutool.cron.pattern.matcher;
|
||||
package cn.hutool.v7.cron.pattern.matcher;
|
||||
@@ -20,4 +20,4 @@
|
||||
* @author Looly
|
||||
*
|
||||
*/
|
||||
package org.dromara.hutool.cron.pattern;
|
||||
package cn.hutool.v7.cron.pattern;
|
||||
@@ -14,17 +14,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.pattern.parser;
|
||||
package cn.hutool.v7.cron.pattern.parser;
|
||||
|
||||
import org.dromara.hutool.core.collection.ListUtil;
|
||||
import org.dromara.hutool.core.date.Month;
|
||||
import org.dromara.hutool.core.date.Week;
|
||||
import org.dromara.hutool.core.math.NumberUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.text.split.SplitUtil;
|
||||
import org.dromara.hutool.cron.CronException;
|
||||
import org.dromara.hutool.cron.pattern.Part;
|
||||
import org.dromara.hutool.cron.pattern.matcher.*;
|
||||
import cn.hutool.v7.core.collection.ListUtil;
|
||||
import cn.hutool.v7.core.date.Month;
|
||||
import cn.hutool.v7.core.date.Week;
|
||||
import cn.hutool.v7.core.math.NumberUtil;
|
||||
import cn.hutool.v7.core.text.StrUtil;
|
||||
import cn.hutool.v7.core.text.split.SplitUtil;
|
||||
import cn.hutool.v7.cron.CronException;
|
||||
import cn.hutool.v7.cron.pattern.Part;
|
||||
import cn.hutool.v7.cron.pattern.matcher.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -14,15 +14,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.pattern.parser;
|
||||
package cn.hutool.v7.cron.pattern.parser;
|
||||
|
||||
import org.dromara.hutool.core.lang.Assert;
|
||||
import org.dromara.hutool.core.text.split.SplitUtil;
|
||||
import org.dromara.hutool.cron.CronException;
|
||||
import org.dromara.hutool.cron.pattern.Part;
|
||||
import org.dromara.hutool.cron.pattern.matcher.AlwaysTrueMatcher;
|
||||
import org.dromara.hutool.cron.pattern.matcher.PartMatcher;
|
||||
import org.dromara.hutool.cron.pattern.matcher.PatternMatcher;
|
||||
import cn.hutool.v7.core.lang.Assert;
|
||||
import cn.hutool.v7.core.text.split.SplitUtil;
|
||||
import cn.hutool.v7.cron.CronException;
|
||||
import cn.hutool.v7.cron.pattern.Part;
|
||||
import cn.hutool.v7.cron.pattern.matcher.AlwaysTrueMatcher;
|
||||
import cn.hutool.v7.cron.pattern.matcher.PartMatcher;
|
||||
import cn.hutool.v7.cron.pattern.matcher.PatternMatcher;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -20,4 +20,4 @@
|
||||
* @author Looly
|
||||
*
|
||||
*/
|
||||
package org.dromara.hutool.cron.pattern.parser;
|
||||
package cn.hutool.v7.cron.pattern.parser;
|
||||
@@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.task;
|
||||
package cn.hutool.v7.cron.task;
|
||||
|
||||
import org.dromara.hutool.cron.pattern.CronPattern;
|
||||
import cn.hutool.v7.cron.pattern.CronPattern;
|
||||
|
||||
/**
|
||||
* 定时作业,此类除了定义了作业,也定义了作业的执行周期以及ID。
|
||||
@@ -14,14 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.task;
|
||||
package cn.hutool.v7.cron.task;
|
||||
|
||||
import org.dromara.hutool.core.classloader.ClassLoaderUtil;
|
||||
import org.dromara.hutool.core.exception.HutoolException;
|
||||
import org.dromara.hutool.core.reflect.ConstructorUtil;
|
||||
import org.dromara.hutool.core.reflect.method.MethodUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.cron.CronException;
|
||||
import cn.hutool.v7.core.classloader.ClassLoaderUtil;
|
||||
import cn.hutool.v7.core.exception.HutoolException;
|
||||
import cn.hutool.v7.core.reflect.ConstructorUtil;
|
||||
import cn.hutool.v7.core.reflect.method.MethodUtil;
|
||||
import cn.hutool.v7.core.text.StrUtil;
|
||||
import cn.hutool.v7.cron.CronException;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.task;
|
||||
package cn.hutool.v7.cron.task;
|
||||
|
||||
/**
|
||||
* {@link Runnable} 的 {@link Task}包装
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.task;
|
||||
package cn.hutool.v7.cron.task;
|
||||
|
||||
/**
|
||||
* 定时作业接口,通过实现execute方法执行具体的任务
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
/**
|
||||
* 定时任务中作业的抽象封装和实现,包括Runnable实现和反射实现<br>
|
||||
* {@link org.dromara.hutool.cron.task.Task}表示一个具体的任务,当满足时间匹配要求时,会执行{@link org.dromara.hutool.cron.task.Task#execute()}方法。
|
||||
* {@link cn.hutool.v7.cron.task.Task}表示一个具体的任务,当满足时间匹配要求时,会执行{@link cn.hutool.v7.cron.task.Task#execute()}方法。
|
||||
*
|
||||
* @author Looly
|
||||
*
|
||||
*/
|
||||
package org.dromara.hutool.cron.task;
|
||||
package cn.hutool.v7.cron.task;
|
||||
@@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.timingwheel;
|
||||
package cn.hutool.v7.cron.timingwheel;
|
||||
|
||||
import org.dromara.hutool.core.thread.ThreadUtil;
|
||||
import cn.hutool.v7.core.thread.ThreadUtil;
|
||||
|
||||
import java.util.concurrent.DelayQueue;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.timingwheel;
|
||||
package cn.hutool.v7.cron.timingwheel;
|
||||
|
||||
/**
|
||||
* 延迟任务
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.timingwheel;
|
||||
package cn.hutool.v7.cron.timingwheel;
|
||||
|
||||
import java.util.concurrent.Delayed;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.timingwheel;
|
||||
package cn.hutool.v7.cron.timingwheel;
|
||||
|
||||
import org.dromara.hutool.log.LogUtil;
|
||||
import cn.hutool.v7.log.LogUtil;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@@ -24,4 +24,4 @@
|
||||
*
|
||||
* @author Looly
|
||||
*/
|
||||
package org.dromara.hutool.cron.timingwheel;
|
||||
package cn.hutool.v7.cron.timingwheel;
|
||||
@@ -14,11 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron;
|
||||
package cn.hutool.v7.cron;
|
||||
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import org.dromara.hutool.core.data.id.IdUtil;
|
||||
import org.dromara.hutool.cron.pattern.CronPattern;
|
||||
import cn.hutool.v7.core.lang.Console;
|
||||
import cn.hutool.v7.core.data.id.IdUtil;
|
||||
import cn.hutool.v7.cron.pattern.CronPattern;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.demo;
|
||||
package cn.hutool.v7.cron.demo;
|
||||
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import org.dromara.hutool.core.thread.ThreadUtil;
|
||||
import org.dromara.hutool.cron.CronUtil;
|
||||
import cn.hutool.v7.core.lang.Console;
|
||||
import cn.hutool.v7.core.thread.ThreadUtil;
|
||||
import cn.hutool.v7.cron.CronUtil;
|
||||
|
||||
public class AddAndRemoveMainTest {
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.demo;
|
||||
package cn.hutool.v7.cron.demo;
|
||||
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import org.dromara.hutool.core.thread.ThreadUtil;
|
||||
import org.dromara.hutool.cron.CronUtil;
|
||||
import org.dromara.hutool.cron.TaskExecutor;
|
||||
import org.dromara.hutool.cron.listener.TaskListener;
|
||||
import org.dromara.hutool.cron.task.Task;
|
||||
import cn.hutool.v7.core.lang.Console;
|
||||
import cn.hutool.v7.core.thread.ThreadUtil;
|
||||
import cn.hutool.v7.cron.CronUtil;
|
||||
import cn.hutool.v7.cron.TaskExecutor;
|
||||
import cn.hutool.v7.cron.listener.TaskListener;
|
||||
import cn.hutool.v7.cron.task.Task;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -14,16 +14,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.demo;
|
||||
package cn.hutool.v7.cron.demo;
|
||||
|
||||
import org.dromara.hutool.core.thread.ThreadUtil;
|
||||
import org.dromara.hutool.cron.CronUtil;
|
||||
import org.dromara.hutool.cron.task.InvokeTask;
|
||||
import cn.hutool.v7.core.thread.ThreadUtil;
|
||||
import cn.hutool.v7.cron.CronUtil;
|
||||
import cn.hutool.v7.cron.task.InvokeTask;
|
||||
|
||||
public class DeamonMainTest {
|
||||
public static void main(final String[] args) {
|
||||
// 测试守护线程是否对作业线程有效
|
||||
CronUtil.schedule("*/2 * * * * *", new InvokeTask("org.dromara.hutool.cron.demo.TestJob.doWhileTest"));
|
||||
CronUtil.schedule("*/2 * * * * *", new InvokeTask("cn.hutool.v7.cron.demo.TestJob.doWhileTest"));
|
||||
// 当为守护线程时,stop方法调用后doWhileTest里的循环输出将终止,表示作业线程正常结束
|
||||
// 当非守护线程时,stop方法调用后,不再产生新的作业,原作业正常执行。
|
||||
CronUtil.setMatchSecond(true);
|
||||
@@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.demo;
|
||||
package cn.hutool.v7.cron.demo;
|
||||
|
||||
import org.dromara.hutool.cron.CronUtil;
|
||||
import cn.hutool.v7.cron.CronUtil;
|
||||
|
||||
/**
|
||||
* 定时任务样例
|
||||
@@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.demo;
|
||||
package cn.hutool.v7.cron.demo;
|
||||
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import org.dromara.hutool.cron.CronUtil;
|
||||
import cn.hutool.v7.core.lang.Console;
|
||||
import cn.hutool.v7.cron.CronUtil;
|
||||
|
||||
public class SimpleDemo {
|
||||
public static void main(String[] args) {
|
||||
@@ -14,12 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.demo;
|
||||
package cn.hutool.v7.cron.demo;
|
||||
|
||||
import org.dromara.hutool.core.date.DateUtil;
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import org.dromara.hutool.core.thread.ThreadUtil;
|
||||
import org.dromara.hutool.core.data.id.IdUtil;
|
||||
import cn.hutool.v7.core.date.DateUtil;
|
||||
import cn.hutool.v7.core.lang.Console;
|
||||
import cn.hutool.v7.core.thread.ThreadUtil;
|
||||
import cn.hutool.v7.core.data.id.IdUtil;
|
||||
|
||||
/**
|
||||
* 测试定时任务,当触发到定时的时间点时,执行doTest方法
|
||||
@@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.demo;
|
||||
package cn.hutool.v7.cron.demo;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.dromara.hutool.core.date.DateUtil;
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import org.dromara.hutool.core.thread.ThreadUtil;
|
||||
import cn.hutool.v7.core.date.DateUtil;
|
||||
import cn.hutool.v7.core.lang.Console;
|
||||
import cn.hutool.v7.core.thread.ThreadUtil;
|
||||
|
||||
/**
|
||||
* 测试定时任务,当触发到定时的时间点时,执行doTest方法
|
||||
@@ -18,4 +18,4 @@
|
||||
* 定时任务示例
|
||||
*
|
||||
*/
|
||||
package org.dromara.hutool.cron.demo;
|
||||
package cn.hutool.v7.cron.demo;
|
||||
@@ -14,11 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.pattern;
|
||||
package cn.hutool.v7.cron.pattern;
|
||||
|
||||
import org.dromara.hutool.core.date.DateField;
|
||||
import org.dromara.hutool.core.date.DateTime;
|
||||
import org.dromara.hutool.core.date.DateUtil;
|
||||
import cn.hutool.v7.core.date.DateField;
|
||||
import cn.hutool.v7.core.date.DateTime;
|
||||
import cn.hutool.v7.core.date.DateUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.pattern;
|
||||
package cn.hutool.v7.cron.pattern;
|
||||
|
||||
import org.dromara.hutool.core.date.DateUtil;
|
||||
import org.dromara.hutool.cron.CronException;
|
||||
import cn.hutool.v7.core.date.DateUtil;
|
||||
import cn.hutool.v7.cron.CronException;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.pattern;
|
||||
package cn.hutool.v7.cron.pattern;
|
||||
|
||||
import org.dromara.hutool.core.date.DateUtil;
|
||||
import cn.hutool.v7.core.date.DateUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.pattern;
|
||||
package cn.hutool.v7.cron.pattern;
|
||||
|
||||
import org.dromara.hutool.core.date.DateUtil;
|
||||
import cn.hutool.v7.core.date.DateUtil;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.pattern;
|
||||
package cn.hutool.v7.cron.pattern;
|
||||
|
||||
import org.dromara.hutool.core.date.DateTime;
|
||||
import org.dromara.hutool.core.date.DateUtil;
|
||||
import cn.hutool.v7.core.date.DateTime;
|
||||
import cn.hutool.v7.core.date.DateUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.pattern;
|
||||
package cn.hutool.v7.cron.pattern;
|
||||
|
||||
import org.dromara.hutool.core.date.DateTime;
|
||||
import org.dromara.hutool.core.date.DateUtil;
|
||||
import cn.hutool.v7.core.date.DateTime;
|
||||
import cn.hutool.v7.core.date.DateUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.pattern;
|
||||
package cn.hutool.v7.cron.pattern;
|
||||
|
||||
import org.dromara.hutool.core.date.DateTime;
|
||||
import org.dromara.hutool.core.date.DateUtil;
|
||||
import org.dromara.hutool.core.date.StopWatch;
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import cn.hutool.v7.core.date.DateTime;
|
||||
import cn.hutool.v7.core.date.DateUtil;
|
||||
import cn.hutool.v7.core.date.StopWatch;
|
||||
import cn.hutool.v7.core.lang.Console;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.pattern.builder;
|
||||
package cn.hutool.v7.cron.pattern.builder;
|
||||
|
||||
import org.dromara.hutool.cron.CronException;
|
||||
import org.dromara.hutool.cron.pattern.Part;
|
||||
import cn.hutool.v7.cron.CronException;
|
||||
import cn.hutool.v7.cron.pattern.Part;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.pattern.parser;
|
||||
package cn.hutool.v7.cron.pattern.parser;
|
||||
|
||||
import org.dromara.hutool.cron.pattern.matcher.PatternMatcher;
|
||||
import cn.hutool.v7.cron.pattern.matcher.PatternMatcher;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.cron.timingwheel;
|
||||
package cn.hutool.v7.cron.timingwheel;
|
||||
|
||||
public class Issue3090Test {
|
||||
public static void main(String[] args) {
|
||||
@@ -22,9 +22,9 @@
|
||||
# 3. 表达式为7位,此时兼容Quartz模式,第一位匹配秒,最后一位匹配年
|
||||
#------------------------------------------------------------------
|
||||
|
||||
# demo.org.dromara.hutool.cron.TestJob.doTest = */1 * * * * *
|
||||
# demo.cn.hutool.v7.cron.TestJob.doTest = */1 * * * * *
|
||||
|
||||
[org.dromara.hutool.cron.demo]
|
||||
[cn.hutool.v7.cron.demo]
|
||||
# 6位表达式在秒匹配模式下可用,此处表示每秒执行一次
|
||||
# TestJob.doTest = */1 * * * * *
|
||||
# 5位表达式在分匹配模式下可用,此处表示每分钟执行一次
|
||||
|
||||
Reference in New Issue
Block a user