/** * Configures an expiry-time cache of the given maximum age in seconds and purge interval in seconds. * <p> * Specifies the cache reference type to be weak references. Weak reference cache entries become * eligible for garbage collection and are removed from cache when the garbage collection requires so. * @param maxAgeSeconds is the maximum number of seconds before a method invocation result is considered stale (also known as time-to-live) * @param purgeIntervalSeconds is the interval at which the engine purges stale data from the cache */ public void setExpiryTimeCache(double maxAgeSeconds, double purgeIntervalSeconds) { dataCacheDesc = new ConfigurationExpiryTimeCache(maxAgeSeconds, purgeIntervalSeconds, ConfigurationCacheReferenceType.getDefault()); }
/** * Configures an expiry-time cache of the given maximum age in seconds and purge interval in seconds. * <p> * Specifies the cache reference type to be weak references. Weak reference cache entries become * eligible for garbage collection and are removed from cache when the garbage collection requires so. * @param maxAgeSeconds is the maximum number of seconds before a query result is considered stale (also known as time-to-live) * @param purgeIntervalSeconds is the interval at which the engine purges stale data from the cache */ public void setExpiryTimeCache(double maxAgeSeconds, double purgeIntervalSeconds) { dataCacheDesc = new ConfigurationExpiryTimeCache(maxAgeSeconds, purgeIntervalSeconds, ConfigurationCacheReferenceType.getDefault()); }
private static void handleMethodReference(Configuration configuration, Element element) { String className = element.getAttributes().getNamedItem("class-name").getTextContent(); ConfigurationMethodRef configMethodRef = new ConfigurationMethodRef(); configuration.addMethodRef(className, configMethodRef); DOMElementIterator nodeIterator = new DOMElementIterator(element.getChildNodes()); while (nodeIterator.hasNext()) { Element subElement = nodeIterator.next(); if (subElement.getNodeName().equals("expiry-time-cache")) { String maxAge = subElement.getAttributes().getNamedItem("max-age-seconds").getTextContent(); String purgeInterval = subElement.getAttributes().getNamedItem("purge-interval-seconds").getTextContent(); ConfigurationCacheReferenceType refTypeEnum = ConfigurationCacheReferenceType.getDefault(); if (subElement.getAttributes().getNamedItem("ref-type") != null) { String refType = subElement.getAttributes().getNamedItem("ref-type").getTextContent(); refTypeEnum = ConfigurationCacheReferenceType.valueOf(refType.toUpperCase()); } configMethodRef.setExpiryTimeCache(Double.parseDouble(maxAge), Double.parseDouble(purgeInterval), refTypeEnum); } else if (subElement.getNodeName().equals("lru-cache")) { String size = subElement.getAttributes().getNamedItem("size").getTextContent(); configMethodRef.setLRUCache(Integer.parseInt(size)); } } }
ConfigurationCacheReferenceType refTypeEnum = ConfigurationCacheReferenceType.getDefault(); if (subElement.getAttributes().getNamedItem("ref-type") != null)