/*
 * Copyright 2008-2012 Microarray Informatics Team, EMBL-European Bioinformatics Institute
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 *
 * For further details of the Gene Expression Atlas project, including source code,
 * downloads and documentation, please see:
 *
 * http://gxa.github.com/gxa
 */

package uk.ac.ebi.atlas.experimentpage.baseline.genedistribution;

import com.google.common.cache.LoadingCache;
import org.apache.log4j.Logger;
import org.springframework.context.annotation.Scope;

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

@Named("barChartTraders")
@Scope("singleton")
public class BarChartTradersCache {

    private static final Logger LOGGER = Logger.getLogger(BarChartTradersCache.class);

    private LoadingCache<String, BarChartTrader> barchartTraders;

    @Inject
    @Named("barChartTradersLoadingCache")
    //this is the name of the implementation being injected, required because LoadingCache is an interface
    public BarChartTradersCache(LoadingCache<String, BarChartTrader> barchartTraders) {
        this.barchartTraders = barchartTraders;
    }

    public BarChartTrader getBarchartTrader(String experimentAccession) {
        try {

            return barchartTraders.get(experimentAccession);

        } catch (ExecutionException e) {
            LOGGER.error(e.getMessage(), e);
            throw new IllegalStateException("Exception while loading histogram data from file: " + e.getMessage(),
                    e.getCause());
        }
    }

}

@@ -956,16 +956,79 @@
 Logger;%0A
+import org.springframework.beans.factory.annotation.Qualifier;%0A
 import o
@@ -1072,16 +1072,16 @@
 .Scope;%0A
-
 %0Aimport 
@@ -1431,56 +1431,15 @@
 ect%0A
-    @Named(%22barChartTradersLoadingCache%22)%0A
     //
+ 
 this
@@ -1567,16 +1567,58 @@
 rsCache(
+@Qualifier(%22barChartTradersLoadingCache%22) 
 LoadingC
@@ -1808,17 +1808,16 @@
   try %7B%0A
-%0A
         
@@ -1869,17 +1869,16 @@
 ssion);%0A
-%0A
         
@@ -1955,16 +1955,16 @@
 (), e);%0A
+
         
@@ -2073,28 +2073,8 @@
 e(),
-%0A                   
  e.g

Fix Spring annotation (Use @Qualifier when multiple implementations are possible)