Package net.sf.jsr107cache

Examples of net.sf.jsr107cache.CacheException


            Class clazz = Class.forName(cacheManagerClass);
            allowedClasses.add(cacheManagerClass);
            cacheManager = (CarbonCacheManager) clazz.newInstance();
            return cacheManager;
        } catch (ClassNotFoundException e) {
            throw new CacheException("No cache manager class by the name " + cacheManagerClass
                    + " was found.", e);
        } catch (Exception e) {
            throw new CacheException("Unable to create an instance of a cache manager.", e);
        }
    }
View Full Code Here


        if (this.configuration != null) {
            // The cache configuration has already been loaded.
            return;
        }
        if (configFilePath == null) {
            throw new CacheException("the path of the cache configuration file was not specified.");
        }
        InputStream configInputStream;
        try {
            configInputStream = new FileInputStream(new File(configFilePath));
        } catch (FileNotFoundException e) {
            throw new CacheException("Cache configuration file (cache.xml) does not exist in the " +
                    "path " + configFilePath, e);
        }
        try {
            OMElement documentElement = new StAXOMBuilder(configInputStream).getDocumentElement();
            Map<String, List<String>> configuration = new HashMap<String, List<String>>();
            readChildElements(documentElement, new Stack<String>(), configuration);
            this.configuration = configuration;
            log.debug("Successfully loaded Cache Configuration");
        } catch (XMLStreamException e) {
            throw new CacheException("Unable to parse the cache configuration.", e);
        } finally {
            try {
                configInputStream.close();
            } catch (IOException ignore) {
                // We only want to ensure that the configuration file is properly closed. Throwing
View Full Code Here

                    timeToLiveSeconds, timeToIdleSeconds, diskPersistent, diskExpiryThreadIntervalSeconds,
                    null, null, maxElementsOnDisk);

            net.sf.ehcache.CacheManager.getInstance().addCache(cache);
        } catch (net.sf.ehcache.CacheException e) {
            throw new CacheException(e.getMessage(), e);
        }


        return new JCache(cache, cacheLoader);
View Full Code Here

TOP

Related Classes of net.sf.jsr107cache.CacheException

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.