package ru.otus.korneev.hmw13.servlet;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import ru.otus.korneev.hmw10.dbService.DBService;
import ru.otus.korneev.hmw11.Cache.CacheEngine;
import ru.otus.korneev.hmw11.Cache.CacheEngineImpl;
import ru.otus.korneev.hmw11.DBServiceWithCache.DBServiceImpWithCache;
import ru.otus.korneev.hmw12.service.AccountService;
import ru.otus.korneev.hmw12.service.AccountServiceImpl;

import java.sql.SQLException;

@Configuration
public class AppConfig {

    @Autowired
    private CacheEngine<Long, Object> cacheEngine;

    @Bean
    public AccountService getAccountService() {
        return new AccountServiceImpl();
    }

    @Bean
    public CacheEngine getCacheEngine() {
        return new CacheEngineImpl(2, 10000, 0, false);
    }

    @Bean
    public DBService getDBService() throws SQLException {
        return new DBServiceImpWithCache(cacheEngine);
    }
}

@@ -818,16 +818,30 @@
 heEngine
+%3CLong, Object%3E
  getCach
@@ -886,16 +886,18 @@
 gineImpl
+%3C%3E
 (2, 1000

add generic