
package uk.ac.ebi.atlas.trader.cache;

import com.google.common.cache.LoadingCache;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Scope;
import uk.ac.ebi.atlas.model.baseline.BaselineExperiment;

import javax.inject.Inject;
import javax.inject.Named;
import java.util.concurrent.ExecutionException;

@Named
@Scope("singleton")
public class RnaSeqBaselineExperimentsCache implements ExperimentsCache<BaselineExperiment> {

    private LoadingCache<String, BaselineExperiment> experiments;

    @Inject
    public RnaSeqBaselineExperimentsCache(@Qualifier("rnaSeqBaselineExperimentsLoadingCache") LoadingCache<String, BaselineExperiment> experiments) {
        this.experiments = experiments;
    }

    @Override
    public BaselineExperiment getExperiment(String experimentAccession) throws ExecutionException {
        return experiments.get(experimentAccession);
    }

    @Override
    public void evictExperiment(String experimentAccession) {
        experiments.invalidate(experimentAccession);
    }

    @Override
    public void evictAll() {
        experiments.invalidateAll();
    }


}

@@ -1,9 +1,8 @@
-%0A
 package 
@@ -144,61 +144,8 @@
 er;%0A
-import org.springframework.context.annotation.Scope;%0A
 impo
@@ -307,35 +307,15 @@
 n;%0A%0A
+
 @Named%0A
-@Scope(%22singleton%22)%0A
 publ

Remove default scope