StartCommand.java 823 Bytes
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();
		}
	}
}