private static void evictionConfigXmlGenerator(XmlGenerator gen, EvictionConfig e) { if (e == null) { return; } String comparatorClassName = !isNullOrEmpty(e.getComparatorClassName()) ? e.getComparatorClassName() : null; gen.node("eviction", null, "size", e.getSize(), "max-size-policy", e.getMaximumSizePolicy(), "eviction-policy", e.getEvictionPolicy(), "comparator-class-name", comparatorClassName); }
private static void evictionConfigXmlGenerator(XmlGenerator gen, EvictionConfig e) { if (e == null) { return; } String comparatorClassName = !isNullOrEmpty(e.getComparatorClassName()) ? e.getComparatorClassName() : null; gen.node("eviction", null, "size", e.getSize(), "max-size-policy", e.getMaximumSizePolicy(), "eviction-policy", e.getEvictionPolicy(), "comparator-class-name", comparatorClassName); }
/** * Checks if a {@link EvictionConfig} is valid in its context. * * @param evictionConfig the {@link EvictionConfig} * @param isNearCache {@code true} if the config is for a Near Cache, {@code false} otherwise */ @SuppressWarnings("ConstantConditions") public static void checkEvictionConfig(EvictionConfig evictionConfig, boolean isNearCache) { if (evictionConfig == null) { throw new IllegalArgumentException("Eviction config cannot be null!"); } EvictionPolicy evictionPolicy = evictionConfig.getEvictionPolicy(); String comparatorClassName = evictionConfig.getComparatorClassName(); EvictionPolicyComparator comparator = evictionConfig.getComparator(); checkEvictionConfig(evictionPolicy, comparatorClassName, comparator, isNearCache); }
/** * Checks if a {@link EvictionConfig} is valid in its context. * * @param evictionConfig the {@link EvictionConfig} * @param isNearCache {@code true} if the config is for a Near Cache, {@code false} otherwise */ @SuppressWarnings("ConstantConditions") public static void checkEvictionConfig(EvictionConfig evictionConfig, boolean isNearCache) { if (evictionConfig == null) { throw new IllegalArgumentException("Eviction config cannot be null!"); } EvictionPolicy evictionPolicy = evictionConfig.getEvictionPolicy(); String comparatorClassName = evictionConfig.getComparatorClassName(); EvictionPolicyComparator comparator = evictionConfig.getComparator(); checkEvictionConfig(evictionPolicy, comparatorClassName, comparator, isNearCache); }
public static EvictionConfigHolder of(EvictionConfig config, SerializationService serializationService) { return new EvictionConfigHolder(config.getSize(), config.getMaximumSizePolicy().name(), config.getEvictionPolicy().name(), config.getComparatorClassName(), serializationService.toData(config.getComparator())); } }
public static EvictionConfigHolder of(EvictionConfig config, SerializationService serializationService) { return new EvictionConfigHolder(config.getSize(), config.getMaximumSizePolicy().name(), config.getEvictionPolicy().name(), config.getComparatorClassName(), serializationService.toData(config.getComparator())); } }