Java配置到XML配置 - Spring Social

时间:2012-10-29 16:35:18

标签: java xml spring-mvc configuration spring-social

我是Java Config&我正在努力将一个基于Java的配置转换为基于XML的配置。 任何人都可以指导我进行转换。非常感谢!

@Bean
@Scope(value="singleton", proxyMode=ScopedProxyMode.INTERFACES) 
public UsersConnectionRepository usersConnectionRepository(AccountRepository accountRepository) {
    JdbcUsersConnectionRepository repository = new JdbcUsersConnectionRepository(
        dataSource, connectionFactoryLocator(), Encryptors.noOpText());
    repository.setConnectionSignUp(new AccountConnectionSignUp(accountRepository));
    return repository;
}

1 个答案:

答案 0 :(得分:1)

好的,发现自己:

<bean id="usersConnectionRepository"
        class="org.springframework.social.connect.jdbc.JdbcUsersConnectionRepository">
        <constructor-arg ref="jpaDataSource" />
        <constructor-arg ref="connectionFactoryLocator" />
        <constructor-arg ref="textEncryptor" />
        <property name="connectionSignUp" ref="accountConnectionSignUp" />
    </bean>

    <bean id="accountConnectionSignUp" class="path to AccountConnectionSignUp" />

这是为了任何人的帮助。谢谢!