Package javax.cache

Examples of javax.cache.CacheException


        }
        for (Future f : loadAllTasks) {
            try {
                f.get(TIMEOUT, TimeUnit.SECONDS);
            } catch (Exception e) {
                throw new CacheException(e);
            }
        }
        loadAllTasks.clear();
        //close the configured CacheLoader
        closeCacheLoader();
View Full Code Here


    public CacheEntryLookup getLookup(String cacheName) throws CacheException {
        if (cacheName == null) {
            cacheName = getProps().getProperty("jpa.cache.name");

            if (cacheName == null)
                throw new CacheException("Missing JPA entity cache name.");
        }

        Cache cache = configureCache(cacheName);
        return factory.createCacheEntryLookup(cacheName, cache);
    }
View Full Code Here

            throw new NullPointerException();
        }

        JCache<K, V> jCache = allCaches.get(cacheName);
        if (jCache != null) {
            throw new CacheException();
        }
        cacheManager.addCacheIfAbsent(new net.sf.ehcache.Cache(toEhcacheConfig(cacheName, configuration)));
        Ehcache ehcache = cacheManager.getEhcache(cacheName);
        final JCacheConfiguration<K, V> cfg = new JCacheConfiguration<K, V>(configuration);
        jCache = new JCache<K, V>(this, cfg, ehcache);
View Full Code Here

            } else {
                unregisterObject(cfgMXBeans.remove(jCache));
            }
            ((JCacheConfiguration)jCache.getConfiguration(JCacheConfiguration.class)).setManagementEnabled(enabled);
        } catch (NotCompliantMBeanException e) {
            throw new CacheException(e);
        } catch (InstanceAlreadyExistsException e) {
            // throw new CacheException(e);
        } catch (MBeanRegistrationException e) {
            throw new CacheException(e);
        } catch (InstanceNotFoundException e) {
            // throw new CacheException(e);
        } catch (MalformedObjectNameException e) {
            throw new CacheException(e);
        }
    }
View Full Code Here

            } else {
                unregisterObject(statMXBeans.remove(jCache));
            }
            ((JCacheConfiguration)jCache.getConfiguration(JCacheConfiguration.class)).setStatisticsEnabled(enabled);
        } catch (NotCompliantMBeanException e) {
            throw new CacheException(e);
        } catch (InstanceAlreadyExistsException e) {
            // throw new CacheException(e);
        } catch (MBeanRegistrationException e) {
            throw new CacheException(e);
        } catch (InstanceNotFoundException e) {
            // throw new CacheException(e);
        } catch (MalformedObjectNameException e) {
            throw new CacheException("Illegal ObjectName for Management Bean. " +
                                     "CacheManager=[" + getURI().toString() + "], Cache=[" + jCache.getName() + "]", e);
        }
    }
View Full Code Here

TOP

Related Classes of javax.cache.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.