All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.mstream.trader.simulation.cache.repository.RepositoryCacheModule Maven / Gradle / Ivy

package io.mstream.trader.simulation.cache.repository;


import com.google.inject.AbstractModule;
import com.google.inject.Scopes;
import com.google.inject.TypeLiteral;
import io.mstream.trader.simulation.stocks.StocksPriceRepository;
import io.mstream.trader.simulation.stocks.datafeed.data.StockPrice;

import javax.cache.Cache;
import java.util.Map;


public class RepositoryCacheModule
        extends AbstractModule {
    
    private static final
    TypeLiteral>
            STOCK_PRICE_REPOSITORY_CACHE_TYPE =
            new TypeLiteral>() {};
    
    private static final
    TypeLiteral>
            CACHES_MAP_TYPE =
            new TypeLiteral>() {};
    
    @Override
    protected void configure() {
        
        bind(STOCK_PRICE_REPOSITORY_CACHE_TYPE)
                .toProvider(StockPriceRepositoryCacheProvider.class)
                .in(Scopes.SINGLETON);
        
        bind(CACHES_MAP_TYPE)
                .toProvider(CachesMapProvider.class)
                .in(Scopes.SINGLETON);
        
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy