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

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

There is a newer version: 1.18
Show newest version
package io.mstream.trader.simulation.cache.repository;


import io.mstream.trader.commons.utils.cache.CachedRepository;
import io.mstream.trader.commons.utils.repository.SingleRepository;
import io.mstream.trader.simulation.stocks.StocksPriceRepository;
import io.mstream.trader.simulation.stocks.datafeed.data.StockPrice;

import javax.cache.Cache;
import javax.inject.Inject;
import javax.inject.Provider;


public class CachedStockPriceRepositoryProvider
        implements Provider> {
    
    private final StocksPriceRepository stocksPriceRepository;
    
    private final Cache cache;
    
    @Inject
    public CachedStockPriceRepositoryProvider(
            StocksPriceRepository stocksPriceRepository,
            Cache cache
    ) {
        
        this.stocksPriceRepository = stocksPriceRepository;
        this.cache = cache;
    }
    
    @Override
    public SingleRepository get() {
        
        return new CachedRepository<>(
                stocksPriceRepository,
                cache
        );
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy