class AutonomicClusterManagementHeuristicService {

    protected ClusterAdministrationHeuristicAlgorithm getInstanceOfClass(String algorithmName) {
        Class<? extends ClusterAdministrationHeuristicAlgorithm> clusterManagerHeuristicAlgorithmClass = algorithmsMap.get(algorithmName);
        if (clusterManagerHeuristicAlgorithmClass != null) {
            return getInstanceOfClass(clusterManagerHeuristicAlgorithmClass);
        }
        try {
            Class<? extends ClusterAdministrationHeuristicAlgorithm> algorithmClass = loadAlgorithmClass(algorithmName);
            return getInstanceOfClass(algorithmClass);
        } catch (Exception e) {
            logger.debug(String.format("Could not load heuristics from algorithm [algorithm class name=%s], using the Dummy management algorithm", algorithmName), e);
            return getDummyClusterManagementHeuristc();
        }
    }

}