/** * Helper method to add a new NearCacheConfig * * @param nearCacheConfig {@link com.hazelcast.config.NearCacheConfig} * @return configured {@link com.hazelcast.client.config.ClientConfig} for chaining * @see com.hazelcast.config.NearCacheConfig */ public ClientConfig addNearCacheConfig(NearCacheConfig nearCacheConfig) { nearCacheConfigMap.put(nearCacheConfig.getName(), nearCacheConfig); return this; }
/** * Helper method to add a new NearCacheConfig * * @param nearCacheConfig {@link com.hazelcast.config.NearCacheConfig} * @return configured {@link com.hazelcast.client.config.ClientConfig} for chaining * @see com.hazelcast.config.NearCacheConfig */ public ClientConfig addNearCacheConfig(NearCacheConfig nearCacheConfig) { nearCacheConfigMap.put(nearCacheConfig.getName(), nearCacheConfig); return this; }
protected void checkAvailable() { if (!isAvailable()) { throw new IllegalStateException(nearCacheConfig.getName() + " named Near Cache record store is not available"); } }
protected void checkAvailable() { if (!isAvailable()) { throw new IllegalStateException(nearCacheConfig.getName() + " named Near Cache record store is not available"); } }
public static NearCacheConfigHolder of(NearCacheConfig config, SerializationService serializationService) { if (config == null) { return null; } return new NearCacheConfigHolder(config.getName(), config.getInMemoryFormat().name(), config.isSerializeKeys(), config.isInvalidateOnChange(), config.getTimeToLiveSeconds(), config.getMaxIdleSeconds(), EvictionConfigHolder.of(config.getEvictionConfig(), serializationService), config.isCacheLocalEntries(), config.getLocalUpdatePolicy().name(), config.getPreloaderConfig()); } }
public static NearCacheConfigHolder of(NearCacheConfig config, SerializationService serializationService) { if (config == null) { return null; } return new NearCacheConfigHolder(config.getName(), config.getInMemoryFormat().name(), config.isSerializeKeys(), config.isInvalidateOnChange(), config.getTimeToLiveSeconds(), config.getMaxIdleSeconds(), EvictionConfigHolder.of(config.getEvictionConfig(), serializationService), config.isCacheLocalEntries(), config.getLocalUpdatePolicy().name(), config.getPreloaderConfig()); } }
@SuppressWarnings("deprecation") private static void mapNearCacheConfigXmlGenerator(XmlGenerator gen, NearCacheConfig n) { if (n != null) { if (n.getName() != null) { gen.open("near-cache", "name", n.getName()); } else { gen.open("near-cache"); } gen.node("in-memory-format", n.getInMemoryFormat()) .node("invalidate-on-change", n.isInvalidateOnChange()) .node("time-to-live-seconds", n.getTimeToLiveSeconds()) .node("max-idle-seconds", n.getMaxIdleSeconds()) .node("serialize-keys", n.isSerializeKeys()) .node("cache-local-entries", n.isCacheLocalEntries()) .node("max-size", n.getMaxSize()) .node("eviction-policy", n.getEvictionPolicy()); evictionConfigXmlGenerator(gen, n.getEvictionConfig()); gen.close(); } }
@SuppressWarnings("deprecation") private static void mapNearCacheConfigXmlGenerator(XmlGenerator gen, NearCacheConfig n) { if (n != null) { if (n.getName() != null) { gen.open("near-cache", "name", n.getName()); } else { gen.open("near-cache"); } gen.node("in-memory-format", n.getInMemoryFormat()) .node("invalidate-on-change", n.isInvalidateOnChange()) .node("time-to-live-seconds", n.getTimeToLiveSeconds()) .node("max-idle-seconds", n.getMaxIdleSeconds()) .node("serialize-keys", n.isSerializeKeys()) .node("cache-local-entries", n.isCacheLocalEntries()) .node("max-size", n.getMaxSize()) .node("eviction-policy", n.getEvictionPolicy()); evictionConfigXmlGenerator(gen, n.getEvictionConfig()); gen.close(); } }