public String toStringRep() { return "lru-entry-count: " + this.lruEntryCount.getMaximum() + ", " + this.lruEntryCount.getAction().toString() + ", " + "\nlru-heap-percentage: " + this.lruHeapPercentage.getAction().toString() + "\nlru-memory-size: " + this.lruMemorySize.getMaximum() + this.lruMemorySize.getAction().toString(); }
private RegionAttributesType getRegionAttribute(RegionConfig config) { if (config.getRegionAttributes() == null) { config.setRegionAttributes(new RegionAttributesType()); } return config.getRegionAttributes(); }
@Override public boolean updateConfigForGroup(String group, CacheConfig config, Object element) { CacheElement.removeElement(config.getJndiBindings(), (String) element); return true; }
private void createAsyncQueue(CacheConfig cacheConfig, RegionAttributesType attributes, String queueName) { AsyncEventQueue asyncEventQueue = new AsyncEventQueue(); asyncEventQueue.setId(queueName); boolean isPartitioned = attributes.getDataPolicy().equals(RegionAttributesDataPolicy.PARTITION) || attributes.getDataPolicy().equals(RegionAttributesDataPolicy.PERSISTENT_PARTITION); asyncEventQueue.setParallel(isPartitioned); DeclarableType listener = new DeclarableType(); listener.setClassName(JdbcAsyncWriter.class.getName()); asyncEventQueue.setAsyncEventListener(listener); cacheConfig.getAsyncEventQueues().add(asyncEventQueue); }
private void checkForCacheLoader(String regionName, RegionConfig regionConfig) throws PreconditionException { RegionAttributesType regionAttributes = regionConfig.getRegionAttributes(); if (regionAttributes != null) { DeclarableType loaderDeclarable = regionAttributes.getCacheLoader(); if (loaderDeclarable != null) { throw new PreconditionException("The existing region " + regionName + " must not already have a cache-loader, but it has " + loaderDeclarable.getClassName()); } } }
public void setLruHeapPercentage(EnumActionDestroyOverflow action) { if (evictionAttributes == null) { evictionAttributes = new EvictionAttributes(); } EvictionAttributes.LruHeapPercentage lruHeapPercentage = new EvictionAttributes.LruHeapPercentage(); lruHeapPercentage.setAction(action); evictionAttributes.setLruHeapPercentage(lruHeapPercentage); }
@Override public boolean exists(RegionConfig config, CacheConfig existing) { return CacheElement.exists(existing.getRegions(), config.getId()); }
/** * @return true if timeout or action is specified */ public boolean hasTimoutOrAction() { return (getTimeout() != null || getAction() != null); }
public <T extends CacheElement> T findCustomRegionElement(String regionPath, String elementId, Class<T> classT) { return findElement(findCustomRegionElements(regionPath, classT), elementId); }
public <T extends CacheElement> T findCustomCacheElement(String elementId, Class<T> classT) { return findElement(findCustomCacheElements(classT), elementId); }
/** * Get the id of the element. The id is the same as the name. * * @return the id of the element */ @Override public String getId() { return getName(); }
public void setLocalMaxMemory(String maxMemory) { if (partitionAttributes == null) { partitionAttributes = new PartitionAttributes(); } partitionAttributes.setLocalMaxMemory(maxMemory); }
@Override public boolean updateConfigForGroup(String group, CacheConfig config, Object configObject) { String diskStoreName = (String) configObject; CacheElement.removeElement(config.getDiskStores(), diskStoreName); return true; } }
public void setInterestPolicy(String interestPolicy) { if (subscriptionAttributes == null) { subscriptionAttributes = new SubscriptionAttributes(); } subscriptionAttributes.setInterestPolicy(interestPolicy); }
@Override public String toString() { if (string != null) { return string; } if (declarable != null) { return declarable.toString(); } return ""; }
/** * Gets the value of the timeout property. * * possible object is * {@link String } * */ public String getTimeout() { return expirationAttributes.getTimeout(); }
/** * Gets the value of the action property. * * possible object is * {@link String } * */ public String getAction() { return expirationAttributes.getAction(); }
/** * Sets the value of the timeout property. * * allowed object is * {@link String } * */ public void setTimeout(String value) { expirationAttributes.setTimeout(value); }
private RegionAttributesType getRegionAttribute(RegionConfig config) { if (config.getRegionAttributes() == null) { config.setRegionAttributes(new RegionAttributesType()); } return config.getRegionAttributes(); }
@Override public boolean updateConfigForGroup(String group, CacheConfig config, Object element) { CacheElement.removeElement(config.getJndiBindings(), (String) element); return true; } }