1.伪代码,大概其是这个意思。
@Component
public class StaticDemo {
@Resource
TestService testService;
private static StaticDemo staticDemo;
@PostConstruct
public void init() {
staticDemo = this;
}
private static void testMethod() {
staticDemo.testService.xxx();
}
}