|
|
@@ -1,42 +0,0 @@
|
|
|
-package com.miekir.shibei.tool.start;
|
|
|
-
|
|
|
-import com.miekir.shibei.tool.web.Sex8Tool;
|
|
|
-import org.springframework.beans.factory.InitializingBean;
|
|
|
-import org.springframework.context.annotation.Scope;
|
|
|
-import org.springframework.stereotype.Component;
|
|
|
-
|
|
|
-import javax.annotation.PostConstruct;
|
|
|
-import java.util.concurrent.Executors;
|
|
|
-
|
|
|
-@Component
|
|
|
-@Scope(value = "prototype")
|
|
|
-public class AllStrategiesExampleBean implements InitializingBean {
|
|
|
-
|
|
|
- public AllStrategiesExampleBean() {
|
|
|
- //System.out.println();
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void afterPropertiesSet() throws Exception {
|
|
|
- // 在IDE debug是初始化两次,但真正打包发布之后,只会执行一次
|
|
|
- Executors.newSingleThreadExecutor().submit(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- // 递归会导致StackOverflowError,所以用循环代替
|
|
|
- boolean shouldContinue = true;
|
|
|
- while (shouldContinue) {
|
|
|
- shouldContinue = Sex8Tool.startGettingData();
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- @PostConstruct
|
|
|
- public void postConstruct() {
|
|
|
- //System.out.println();
|
|
|
- }
|
|
|
-
|
|
|
- public void init() {
|
|
|
- //System.out.println();
|
|
|
- }
|
|
|
-}
|