public void initialize(IRuntimeServices rs) { this.rsvc = rs; int @int = this.rsvc.GetInt("resource.manager.defaultcache.size", 89); if (@int > 0) { LRUMap lRUMap = LRUMap.Synchronized(new LRUMap(@int)); lRUMap.AddAll(this.cache); this.cache = lRUMap; } this.rsvc.Info("ResourceCache : initialized. (" + base.GetType() + ")"); }
/// <seealso cref="org.apache.velocity.runtime.resource.ResourceCache.Initialize(org.apache.velocity.runtime.RuntimeServices)"> /// </seealso> public virtual void Initialize(IRuntimeServices rs) { rsvc = rs; int maxSize = rsvc.GetInt(NVelocity.Runtime.RuntimeConstants.RESOURCE_MANAGER_DEFAULTCACHE_SIZE, 89); if (maxSize > 0) { // Create a whole new Map here to avoid hanging on to a // handle to the unsynch'd LRUMap for our lifetime. LRUMap lruCache = LRUMap.Synchronized(new LRUMap(maxSize)); lruCache.AddAll(cache); cache = lruCache; } rsvc.Log.Debug("ResourceCache: initialized (" + this.GetType() + ") with " + cache.GetType() + " cache map."); }
public void initialize(IRuntimeServices rs) { runtimeServices = rs; int maxSize = runtimeServices.GetInt(RuntimeConstants.RESOURCE_MANAGER_DEFAULTCACHE_SIZE, 89); if (maxSize > 0) { // Create a whole new Map here to avoid hanging on to a // handle to the unsynch'd LRUMap for our lifetime. LRUMap lruCache = LRUMap.Synchronized(new LRUMap(maxSize)); lruCache.AddAll(cache); cache = lruCache; } runtimeServices.Info(string.Format("ResourceCache : initialized. ({0})", GetType())); }
public void initialize(RuntimeServices rs) { rsvc = rs; int maxSize = rsvc.getInt(RuntimeConstants_Fields.RESOURCE_MANAGER_DEFAULTCACHE_SIZE, 89); if (maxSize > 0) { // Create a whole new Map here to avoid hanging on to a // handle to the unsynch'd LRUMap for our lifetime. LRUMap lruCache = LRUMap.Synchronized(new LRUMap(maxSize)); lruCache.AddAll(cache); cache = lruCache; } rsvc.info("ResourceCache : initialized. (" + this.GetType() + ")"); }