-
大小: 1.44MB文件类型: .rar金币: 2下载: 0 次发布日期: 2023-08-30
- 语言: 其他
- 标签: springboot
资源简介
在springboot中通过读取数据库的定时任务信息,动态生成quartz定时任务

代码片段和文件信息
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License Version 2.0 (the
“License“); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing
software distributed under the License is distributed on an
“AS IS“ BASIS WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import java.util.Properties;
public class MavenWrapperDownloader {
/**
* Default URL to download the maven-wrapper.jar from if no ‘downloadUrl‘ is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL =
“https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar“;
/**
* Path to the maven-wrapper.properties file which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
“.mvn/wrapper/maven-wrapper.properties“;
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
“.mvn/wrapper/maven-wrapper.jar“;
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = “wrapperUrl“;
public static void main(String args[]) {
System.out.println(“- Downloader started“);
File baseDirectory = new File(args[0]);
System.out.println(“- Using base directory: “ + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if (mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL url);
} catch (IOException e) {
Syste
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 277 2019-02-24 15:47 quartz02\.gitignore
文件 48337 2019-02-24 15:47 quartz02\.mvn\wrapper\maven-wrapper.jar
文件 116 2019-02-24 15:47 quartz02\.mvn\wrapper\maven-wrapper.properties
文件 4628 2019-02-24 15:48 quartz02\.mvn\wrapper\MavenWrapperDownloader.java
文件 789 2019-02-24 15:47 quartz02\HELP.md
文件 9113 2019-02-24 15:47 quartz02\mvnw
文件 5810 2019-02-24 15:47 quartz02\mvnw.cmd
文件 5172 2019-02-25 10:59 quartz02\pom.xm
文件 11062 2019-02-24 16:28 quartz02\quartz02.iml
文件 833 2019-02-25 15:21 quartz02\src\main\java\com\zking\quartz02\config\MyWebAppConfigurer.java
文件 5802 2019-02-25 16:20 quartz02\src\main\java\com\zking\quartz02\controller\FtlController.java
文件 671 2019-02-24 16:55 quartz02\src\main\java\com\zking\quartz02\mapper\ScheduleTriggerMapper.java
文件 4115 2019-02-24 16:49 quartz02\src\main\java\com\zking\quartz02\mapper\ScheduleTriggerMapper.xm
文件 775 2019-02-24 16:55 quartz02\src\main\java\com\zking\quartz02\mapper\ScheduleTriggerParamMapper.java
文件 3960 2019-02-24 16:50 quartz02\src\main\java\com\zking\quartz02\mapper\ScheduleTriggerParamMapper.xm
文件 1328 2019-02-24 16:31 quartz02\src\main\java\com\zking\quartz02\model\ScheduleTrigger.java
文件 1253 2019-02-24 16:31 quartz02\src\main\java\com\zking\quartz02\model\ScheduleTriggerParam.java
文件 539 2019-02-25 08:59 quartz02\src\main\java\com\zking\quartz02\quartz\MyJob.java
文件 797 2019-02-25 09:02 quartz02\src\main\java\com\zking\quartz02\quartz\MyJob1.java
文件 657 2019-02-25 09:01 quartz02\src\main\java\com\zking\quartz02\quartz\MyJob2.java
文件 1066 2019-02-25 09:30 quartz02\src\main\java\com\zking\quartz02\quartz\MyJobFactory.java
文件 1761 2019-02-24 16:46 quartz02\src\main\java\com\zking\quartz02\quartz\QuartzConfiguration.java
文件 546 2019-02-25 10:26 quartz02\src\main\java\com\zking\quartz02\Quartz02Application.java
文件 902 2019-02-25 15:49 quartz02\src\main\java\com\zking\quartz02\service\impl\OutScheduleTriggerServiceImpl.java
文件 807 2019-02-24 16:58 quartz02\src\main\java\com\zking\quartz02\service\impl\ScheduleTriggerParamServiceImpl.java
文件 5034 2019-02-25 08:44 quartz02\src\main\java\com\zking\quartz02\service\impl\ScheduleTriggerServiceImpl.java
文件 435 2019-02-24 16:58 quartz02\src\main\java\com\zking\quartz02\service\ScheduleTriggerParamService.java
文件 517 2019-02-25 15:49 quartz02\src\main\java\com\zking\quartz02\service\ScheduleTriggerService.java
文件 6543 2019-02-24 16:36 quartz02\src\main\java\com\zking\quartz02\util\DruidConnectionProvider.java
文件 3497 2019-02-25 10:05 quartz02\src\main\resources\application.yml
............此处省略336个文件信息
相关资源
- SpringBoot+H2+mybatis-plus59130
- springboot+rabbitmq项目demo(亲测可正常运
- springboot整合RabbitMQ实现延时队列的两
- 2017年-传智播客-张志君老师-SpringBoo
- springboot+mybatis整合实现注册登录
- springboot+webflux+mongodb+freemarker
- springboot整合activiti完整demo
- SpringBoot实战(第4版)清晰版.pdf.zip
- SpringBoot 中文文档
- springboot+jpa+thymeleaf实现增删改查分页
- es(elasticsearch)整合SpringCloudSpringBo
- Springboot日志开启SLF4J过程解析
- springboot全套教程2018年2.0版本
- 官网springboot项目
- SpringBoot+Mybatis+前后台隔离技术,完整
- Spring Boot技术栈博客企业前后端2018
- springboot从入门到精通视频教程课程源
- SpringBoot +vue 框架项目.zip
- springBoot+security+oauth2 资源和认证分离
- 基于yml 配置方式 ,实现springBoot+sha
- springboot集成activiti5.22
- SpringBoot官方文档(中文版).pdf
- 2018年SpringBoot与Shiro整合-权限管理实战
- spring boot整合activiti modeler
- springboot1.x整合elasticsearch5.x
- 将rtsp转码为flv格式用于h5播放前端使
- MQTT-1.zip
- 2-springboot cloud 28题选择题和2简答题
- 11-SpringBoot视频教程-精辟易懂
- (视频和源码)spring boot cloud实战租房
评论
共有 条评论