title: Spring: Autowired or "Plain" Call by using the @Configuration annotations?
body: <p>i have the following JAVA supported in Spring 4.0.3 configuration, that have two DataSource und JdbcTemplate beans:</p>
  
  <pre><code>@PropertySource("classpath:db.properties")
  @Configuration
  public class DBConfiguration {
  .....
      @Autowired
      Environment env;
  
      @Bean
      public DataSource internalDataSource() {
          DriverManagerDataSource dataSource = new DriverManagerDataSource();
  
  // init dataSource  setters for DATABASE_1
  
          return dataSource;
      }
  
  
      @Bean
      public DataSource publicDataSource() {
          DriverManagerDataSource dataSource = new DriverManagerDataSource();
  
  // init dataSource  setters for DATABASE_2
  
          return dataSource;
      }
  }
  </code></pre>
  
  <p>...
      @Bean
      public JdbcTemplate internalJDBCTemplate() {
          return new JdbcTemplate(internalDataSource());
      }</p>
  
  <pre><code>@Bean
  public JdbcTemplate publicJDBCTemplate() {
      return new JdbcTemplate(publicDataSource());
  }
  ___
  </code></pre>
  
  <p>I have other configuration bean class, that autowires the first configuration and calls internalDataSource() method:</p>
  
  <pre><code>    @Import(DBConfiguration.class)
      @Configuration
  
   public class AuthConfiguration {
  
          @Autowired
          private DBConfiguration dbConfiguration;
  
          @Autowired
          private TokenStore tokenStore;
  
         @Bean
          public TokenStore tokenStore() {
              return new JdbcTokenStore(dbConfiguration.securityDataSource());
          }
  ...}
  </code></pre>
  
  <p>I suppose, that even DBConfiguration was imported and autowired into AuthConfiguration class, the each call of dbConfiguration.securityDataSource() will be cause the new DriverManagerDataSource() with each time intializing of data source.</p>
  
  <p>Is it correkt or not?</p>