class AdminCacheUtils {

    public DataProvider getProvider(final Class clazz) {
        DataProvider result = providers.get(clazz);
        if (result == null) {
            //Use hardcoded data providers - fastest and not problematic
            for (DataProvider provider : allProviders) {
                if (provider.accept(clazz)) {
                    providers.put(clazz, provider);
                    return provider;
                }
            }
//            ServiceLocator habitat = Globals.getDefaultHabitat();
//            if (habitat != null) {
//                List<DataProvider> allServices = habitat.getAllServices(DataProvider.class);
//                for (DataProvider provider : allServices) {
//                    if (provider.accept(clazz)) {
//                        providers.put(clazz, provider);
//                        return provider;
//                    }
//                }
//            }
//            for (DataProvider provider : dataProviderLoader) {
//                if (provider.accept(clazz)) {
//                    providers.put(clazz, provider);
//                    return provider;
//                }
//            }
            
            return null;
        } else {
            return result;
        }
    }

    private  AdminCacheUtils();

}