StartCommand.java
823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.bsth;
import com.bsth.security.SecurityMetadataSourceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
/**
* 随应用启动运行
* @author PanZhao
*
*/
@Component
public class StartCommand implements CommandLineRunner{
Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
SecurityMetadataSourceService invocationSecurityMetadataSourceService;
@Override
public void run(String... arg0){
try {
//启动时加载所有资源
invocationSecurityMetadataSourceService.loadResourceDefine();
} catch (Exception e) {
e.printStackTrace();
}
}
}