class DbResourceGroupConfigurationManager extends AbstractResourceConfigurationManager {

    @Override
    public void configure(ResourceGroup group, SelectionContext<ResourceGroupIdTemplate> criteria)
    {
        ResourceGroupSpec groupSpec = getMatchingSpec(group, criteria);
        if (groups.putIfAbsent(group.getId(), group) == null) {
            // If a new spec replaces the spec returned from getMatchingSpec the group will be reconfigured on the next run of load().
            configuredGroups.computeIfAbsent(criteria.getContext(), v -> synchronizedList(new ArrayList<>())).add(group.getId());
        }
        synchronized (getRootGroup(group.getId())) {
            configureGroup(group, groupSpec);
        }
    }

    @Inject public  DbResourceGroupConfigurationManager(ClusterMemoryPoolManager memoryPoolManager, DbResourceGroupConfig config, ResourceGroupsDao dao, @ForEnvironment String environment);

}