标签:cto ons logger wired bsp span 方法 sage this
@Component // 注入为spring bean public class TestMsg{ private static final Logger logger = LoggerFactory.getLogger(TestMsg.class); @Autowired private TestService testService; private static TestMsg testMsg; // 保存初始化时注入到的testService public void handlerMessage(MessageVO message) { testMsg.testService.doSomething(); // 用testMsg里set的testService去执行service方法 } @PostConstruct public void init() { testMsg = this; testMsg.testService= this.testService; } }
标签:cto ons logger wired bsp span 方法 sage this
原文地址:https://www.cnblogs.com/jinwenb/p/10408298.html