第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

為什么在類中定義幾個(gè)@Bean注解,同時(shí)指定initMethod和destroyMethod時(shí),在測(cè)試時(shí)會(huì)帶有其他Bean的初始和銷毀方法

@Configuration

@ImportResource("classpath:spring-beanannotation.xml")

public class StoreConfig {

@Value(value="${jdbc.url}")

private String url;

@Value(value="${jdbc.username}")

private String username;

@Value(value="${jdbc.password}")

private String password;

@Bean(name="sugerStore")

public Store getSugerStore(){

return new SugerStore();

}

@Bean(name="robotStore",initMethod="init",destroyMethod="destory")

public Store getRobotStore(){

return new RobotStore();

}

@Bean(name="driverStore")

public Store getDriverStore(){

return new DriverStore(url, username, password);

}

}


正在回答

1 回答

有指定initMethod和destroyMethod時(shí),再帶有其他的初始化方法時(shí),默認(rèn)的不會(huì)生效??赡躼ml中配置了全局的方法了。


0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

為什么在類中定義幾個(gè)@Bean注解,同時(shí)指定initMethod和destroyMethod時(shí),在測(cè)試時(shí)會(huì)帶有其他Bean的初始和銷毀方法

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)