Package de.innovationgate.utils.cache

Examples of de.innovationgate.utils.cache.Cache


        if (getType() == WGDocument.TYPE_FILECONTAINER && _manager.isStrictFCDateDetermination()) {
            lastModified = determineFileContainerLastModified();
        }
       
        // Check the cache
        Cache cache = _manager.getCore().getDesignFileCache();
       
        // We need to include the reference of the current provider here bc. the codefile path itself may be not full-qualified
        // (for example when it reflects the path inside a ZIP file)
        String cacheKey = _manager.getDesignReference() + "/" + getCodeFile().getName().getPath();
      
        try {
            Data cacheData = (Data) cache.readEntry(cacheKey);
            if (cacheData != null && cacheData.getLastModified() >= lastModified && cacheData.isMdFileExists() == mdFile.exists() && cacheData.getEncoding().equals(_manager.getFileEncoding())) {
                _data = cacheData;
                return cacheData;
            }
        }
        catch (CacheException e) {
            _manager.getLog().error("Exception checking design cache", e);
        }
       
        // Build a new data object and put it to cache
        DesignMetadata metadata = (DesignMetadata) readMetaData();
        String code = readCode(metadata);
        _data = new Data(metadata, code, lastModified, _manager.getFileEncoding(), mdFile.exists());
       
        try {
            cache.writeEntry(cacheKey, _data);       
        }
        catch (CacheException e) {
            _manager.getLog().error("Exception writing design cache", e);
        }
       
View Full Code Here


    }

    private synchronized void init() throws CacheException {
       
        Cache oldCache = _cache;
        _cache = CacheFactory.createCache("WebTMLCache-" + increaseCacheIndex(), _capacity, null);
        if (oldCache != null) {
            oldCache.destroy();
        }
    }
View Full Code Here

TOP

Related Classes of de.innovationgate.utils.cache.Cache

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.