1、In the sample code, I'm using a spring ApplicationContext that ensures this is the case, because it automatically pre-instantiates all singleton beans.
3、在示例代碼中,我用Spring的ApplicationContext確保了這種情況,因為它會自動地預先實例化所有單體bean。
2、正如您所看到的,基於Spring的實現的代碼主要使用ApplicationContext來初始化spring組件和檢索要使用的bean。