Browse Source

[SPR-8401] Added missing TransferServiceConfig code listing.

pull/7/head
Sam Brannen 13 years ago
parent
commit
f0ded6a91f
  1. 22
      spring-framework-reference/src/testing.xml

22
spring-framework-reference/src/testing.xml

@ -1491,14 +1491,26 @@ public class JndiDataConfig {
}</programlisting> }</programlisting>
<programlisting language="java">@Configuration <programlisting language="java">@Configuration
@Profile("production") public class TransferServiceConfig {
public class JndiDataConfig {
@Autowired DataSource dataSource;
@Bean @Bean
public DataSource dataSource() throws Exception { public TransferService transferService() {
Context ctx = new InitialContext(); return new DefaultTransferService(accountRepository(),
return (DataSource) ctx.lookup("java:comp/env/jdbc/datasource"); feePolicy());
} }
@Bean
public AccountRepository accountRepository() {
return new JdbcAccountRepository(dataSource);
}
@Bean
public FeePolicy feePolicy() {
return new ZeroFeePolicy();
}
}</programlisting> }</programlisting>
<programlisting language="java">package com.bank.service; <programlisting language="java">package com.bank.service;

Loading…
Cancel
Save