1、获取当前线程pid--dubbo源码
private static int PID = -1;
public static int getPid() {
if (PID < 0) {
try {
RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
String name = runtime.getName(); // format: "pid@hostname"
PID = Integer.parseInt(name.substring(0, name.indexOf('@')));
} catch (Throwable e) {
PID = 0;
}
}
return PID;
}
2、spring解析 Autowired和Value注解类
AutowiredAnnotationBeanPostProcessor