private void writeCommonCacheAttributesElements( XMLExtendedStreamWriter writer, String name, Configuration configuration) throws XMLStreamException { writer.writeAttribute(Attribute.NAME, name); configuration .jmxStatistics() .attributes() .write(writer, JMXStatisticsConfiguration.ENABLED, Attribute.STATISTICS); if (configuration.deadlockDetection().enabled()) { writer.writeAttribute( Attribute.SPIN_DURATION, Long.toString(configuration.deadlockDetection().spinDuration())); } configuration.unsafe().attributes().write(writer); writeBackup(writer, configuration); configuration.sites().backupFor().attributes().write(writer, Element.BACKUP_FOR.getLocalName()); configuration.locking().attributes().write(writer, Element.LOCKING.getLocalName()); writeTransaction(writer, configuration); configuration.eviction().attributes().write(writer, Element.EVICTION.getLocalName()); configuration.expiration().attributes().write(writer, Element.EXPIRATION.getLocalName()); if (configuration.compatibility().enabled()) configuration .compatibility() .attributes() .write(writer, Element.COMPATIBILITY.getLocalName()); if (configuration.storeAsBinary().enabled()) configuration .storeAsBinary() .attributes() .write(writer, Element.STORE_AS_BINARY.getLocalName()); writePersistence(writer, configuration); configuration.versioning().attributes().write(writer, Element.VERSIONING.getLocalName()); writeDataContainer(writer, configuration); writeIndexing(writer, configuration); writeCustomInterceptors(writer, configuration); writeSecurity(writer, configuration); if (configuration.clustering().cacheMode().needsStateTransfer()) { configuration .clustering() .stateTransfer() .attributes() .write(writer, Element.STATE_TRANSFER.getLocalName()); } configuration .clustering() .partitionHandling() .attributes() .write(writer, Element.PARTITION_HANDLING.getLocalName()); }