caches.add(cacheEntry.getValue());
}
// for (ModelNode cache: container.get(ModelKeys.CACHE).asList()) {
for (ModelNode cache: caches) {
CacheMode mode = CacheMode.valueOf(cache.get(ModelKeys.MODE).asString());
if (mode.isClustered()) {
if (mode.isDistributed()) {
writer.writeStartElement(Element.DISTRIBUTED_CACHE.getLocalName());
// write identifier before other attributes
this.writeRequired(writer, Attribute.NAME, cache, ModelKeys.NAME);
this.writeOptional(writer, Attribute.OWNERS, cache, ModelKeys.OWNERS);
this.writeOptional(writer, Attribute.VIRTUAL_NODES, cache, ModelKeys.VIRTUAL_NODES);
this.writeOptional(writer, Attribute.L1_LIFESPAN, cache, ModelKeys.L1_LIFESPAN);
} else if (mode.isInvalidation()) {
writer.writeStartElement(Element.INVALIDATION_CACHE.getLocalName());
// write identifier before other attributes
this.writeRequired(writer, Attribute.NAME, cache, ModelKeys.NAME);
} else {
writer.writeStartElement(Element.REPLICATED_CACHE.getLocalName());