while (layer != null) {
for( Extent extent : layer.getLayerExtents() ){
allExtentsCache.put(extent.getName(), extent );
}
for( Dimension dimension : layer.getLayerDimensions() ){
Extent extent = dimension.getExtent(); // only for WMS 1.3.0
if( extent == null || extent.isEmpty() ){
continue;
}
allExtentsCache.put(extent.getName(), extent );
}
layer = layer.getParent();
}
}
return Collections.unmodifiableMap( allExtentsCache );