}
if (tileLayer.getGridSubsets().isEmpty()) {
tileLayer.setEnabled(false);
}
try {
Configuration configuration = tld.modify(tileLayer);
changedConfigs.add(configuration);
} catch (IllegalArgumentException ignore) {
// layer removed? don't care
}
} finally {
if(lock != null) {
lock.release();
}
}
}
// All referencing layers updated, now can remove the gridsets
for (String gridSetId : gridsetIds) {
Configuration configuration = tld.removeGridset(gridSetId);
changedConfigs.add(configuration);
}
// now make it all persistent
for (Configuration config : changedConfigs) {