1
ZookeeperからプロパティをロードするためのFactoryBeanyの作成。 XMLを使用している間 PropertySourcesPlaceholderConfigurerの参照としてのSpring FactoryBean
public class ZkPropertiesFactoryBean extends AbstractFactoryBean<Properties> {..}
は私が
@Bean
public static PropertySourcesPlaceholderConfigurer loadProperties() throws Exception {
PropertySourcesPlaceholderConfigurer prop = new PropertySourcesPlaceholderConfigurer();
prop.setIgnoreUnresolvablePlaceholders(true);
return prop;
}
何ですかPropertySourcesPlaceholderConfigurer
を使用して、JavaのコンフィグにXML設定を変換しようとしている<bean id="zkProperties" class="test.ZkPropertiesFactoryBean"/>
<context:property-placeholder properties-ref="zkProperties"/>
を次のようにBeanを参照することが可能であるconfigコンproperties-ref
に相当しますか?私は同じことをするための参照を見つけることができません。