package com.alibaba;
import java.util.concurrent.TimeUnit;
import javax.servlet.MultipartConfigElement;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.embedded.EmbeddedServletContainerFactory;
import org.springframework.boot.context.embedded.MultipartConfigFactory;
import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.scheduling.annotation.EnableScheduling;
@ComponentScan
@EnableAutoConfiguration
@EnableScheduling
@Configuration
public class App {
@Value("${server.port}")
private int port;
@Value("${server.sessionTimeout}")
private int sessionTimeout;
public static void main(String[] args) {
SpringApplication.run(App.class, args);
}
@Bean
public EmbeddedServletContainerFactory servletContainer() {
TomcatEmbeddedServletContainerFactory factory = new TomcatEmbeddedServletContainerFactory();
factory.setPort(port);
factory.setSessionTimeout(sessionTimeout, TimeUnit.SECONDS);
return factory;
}
@Bean
public MultipartConfigElement multipartConfigElement() {
MultipartConfigFactory factory = new MultipartConfigFactory();
factory.setMaxFileSize("102400KB");
factory.setMaxRequestSize("102400KB");
return factory.createMultipartConfig();
}
}
@Configuration
@ImportResource("/spring/applicationContext.xml")
class XmlImportingConfiguration {
}
没有合适的资源?快使用搜索试试~ 我知道了~
maven工程-基于springboot定时任务
共25个文件
properties:6个
xml:4个
lst:3个
5星 · 超过95%的资源 需积分: 20 1.1k 下载量 5 浏览量
2016-07-21
18:18:01
上传
评论 6
收藏 9.41MB ZIP 举报
温馨提示
基于springboot的定时任务实现
资源推荐
资源详情
资源评论
收起资源包目录
hello-springboot.zip (25个子文件)
hello-springboot
src
main
resources
spring
applicationContext.xml 1KB
config
application.properties 1KB
log4j.properties 2KB
java
com
alibaba
App.java 2KB
task
ScheduledTest.java 1KB
test
resources
java
.classpath 1KB
.settings
org.eclipse.m2e.core.prefs 90B
org.eclipse.core.resources.prefs 243B
org.eclipse.jdt.core.prefs 736B
pom.xml 2KB
target
classes
META-INF
MANIFEST.MF 279B
maven
hello-springboot
hello-springboot
pom.properties 243B
pom.xml 2KB
com
alibaba
XmlImportingConfiguration.class 510B
App.class 2KB
task
ScheduledTest.class 2KB
spring
applicationContext.xml 1KB
config
application.properties 1KB
log4j.properties 2KB
hello-springboot-0.0.1-SNAPSHOT.jar 9.39MB
maven-archiver
pom.properties 131B
test-classes
maven-status
maven-compiler-plugin
compile
default-compile
inputFiles.lst 704B
createdFiles.lst 360B
testCompile
default-testCompile
inputFiles.lst 0B
.project 568B
共 25 条
- 1
loongshawn
- 粉丝: 637
- 资源: 14
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
前往页