*
* @param element
* @param cacheConfiguration
*/
public static void addCommonAttributesWithDefaultCache(NodeElement element, CacheConfiguration cacheConfiguration) {
element.addAttribute(new SimpleNodeAttribute("eternal", cacheConfiguration.isEternal()).optional(false));
element.addAttribute(new SimpleNodeAttribute("maxElementsInMemory", cacheConfiguration.getMaxElementsInMemory()).optional(false));
element.addAttribute(new SimpleNodeAttribute("overflowToDisk", cacheConfiguration.isOverflowToDisk()).optional(false));
element.addAttribute(new SimpleNodeAttribute("clearOnFlush", cacheConfiguration.isClearOnFlush()).optional(true).defaultValue(
String.valueOf(CacheConfiguration.DEFAULT_CLEAR_ON_FLUSH)));
element.addAttribute(new SimpleNodeAttribute("diskAccessStripes", cacheConfiguration.getDiskAccessStripes()).optional(true)
.defaultValue(CacheConfiguration.DEFAULT_DISK_ACCESS_STRIPES));
element.addAttribute(new SimpleNodeAttribute("diskPersistent", cacheConfiguration.isDiskPersistent()).optional(true).defaultValue(
CacheConfiguration.DEFAULT_DISK_PERSISTENT));
element.addAttribute(new SimpleNodeAttribute("diskSpoolBufferSizeMB", cacheConfiguration.getDiskSpoolBufferSizeMB()).optional(true)
.defaultValue(CacheConfiguration.DEFAULT_SPOOL_BUFFER_SIZE));
element
.addAttribute(new SimpleNodeAttribute("diskExpiryThreadIntervalSeconds", cacheConfiguration
.getDiskExpiryThreadIntervalSeconds()).optional(true).defaultValue(
CacheConfiguration.DEFAULT_EXPIRY_THREAD_INTERVAL_SECONDS));
element.addAttribute(new SimpleNodeAttribute("copyOnWrite", cacheConfiguration.isCopyOnWrite()).optional(true).defaultValue(
CacheConfiguration.DEFAULT_COPY_ON_WRITE));
element.addAttribute(new SimpleNodeAttribute("copyOnRead", cacheConfiguration.isCopyOnRead()).optional(true).defaultValue(
CacheConfiguration.DEFAULT_COPY_ON_READ));
element.addAttribute(new SimpleNodeAttribute("timeToIdleSeconds", cacheConfiguration.getTimeToIdleSeconds()).optional(true)
.defaultValue(CacheConfiguration.DEFAULT_TTI));
element.addAttribute(new SimpleNodeAttribute("timeToLiveSeconds", cacheConfiguration.getTimeToLiveSeconds()).optional(true)
.defaultValue(CacheConfiguration.DEFAULT_TTL));
element.addAttribute(new SimpleNodeAttribute("maxElementsOnDisk", cacheConfiguration.getMaxElementsOnDisk()).optional(true)
.defaultValue(CacheConfiguration.DEFAULT_MAX_ELEMENTS_ON_DISK));
element.addAttribute(new SimpleNodeAttribute("maxMemoryOffHeap", cacheConfiguration.getMaxMemoryOffHeap()).optional(true)
.defaultValue((String) null));
element.addAttribute(new SimpleNodeAttribute("overflowToOffHeap", cacheConfiguration.isOverflowToOffHeap()).optional(true)
.defaultValue(false));
element.addAttribute(new SimpleNodeAttribute("cacheLoaderTimeoutMillis", cacheConfiguration.getCacheLoaderTimeoutMillis())
.optional(true).defaultValue(0L));
element.addAttribute(new SimpleNodeAttribute("transactionalMode", cacheConfiguration.getTransactionalMode()).optional(true)
.defaultValue(CacheConfiguration.DEFAULT_TRANSACTIONAL_MODE));
element.addAttribute(new SimpleNodeAttribute("statistics", cacheConfiguration.getStatistics()).optional(true).defaultValue(
CacheConfiguration.DEFAULT_STATISTICS));
element.addAttribute(new SimpleNodeAttribute("memoryStoreEvictionPolicy", MemoryStoreEvictionPolicyEnum.valueOf(cacheConfiguration
.getMemoryStoreEvictionPolicy().toString())).optional(true).defaultValue(
CacheConfiguration.DEFAULT_MEMORY_STORE_EVICTION_POLICY.toString().toLowerCase()));
}