Package com.impetus.kundera.cache

Examples of com.impetus.kundera.cache.CacheException


    }
   
    @Test
    public void testCacheException()
    {
        CacheException exception = new CacheException("Error with string");
        Assert.assertNotNull(exception);
       
        exception = new CacheException("Error with string", new RuntimeException());
        Assert.assertNotNull(exception);
       
        exception = new CacheException(new RuntimeException());
        Assert.assertNotNull(exception);
       
      
    }
View Full Code Here


                cacheProvider = cacheProviderClass.newInstance();
                cacheProvider.init(classResourceName);
            }
            catch (ClassNotFoundException e)
            {
                throw new CacheException("Could not find class " + cacheProviderClassName
                        + ". Check whether you spelled it correctly in persistence.xml", e);
            }
            catch (InstantiationException e)
            {
                throw new CacheException("Could not instantiate " + cacheProviderClassName, e);
            }
            catch (IllegalAccessException e)
            {
                throw new CacheException(e);
            }
        }
        if (cacheProvider == null)
        {
            cacheProvider = new NonOperationalCacheProvider();
View Full Code Here

        {
            if (e.getMessage().startsWith(
                    "Cannot parseConfiguration CacheManager. Attempt to create a new instance of "
                            + "CacheManager using the diskStorePath"))
            {
                throw new CacheException("Could not init EhCacheFactory.", e);
            }
            else
            {
                throw e;
            }
View Full Code Here

        {
            if (e.getMessage().startsWith(
                    "Cannot parseConfiguration CacheManager. Attempt to create a new instance of "
                            + "CacheManager using the diskStorePath"))
            {
                throw new CacheException("Could not init EhCacheFactory.", e);
            }
            else
            {
                throw new CacheException(e);
            }
        }
        finally
        {
            initializing = false;
View Full Code Here

    @Override
    public Cache createCache(String name)
    {
        if (manager == null)
        {
            throw new CacheException("CacheFactory was not initialized. Call init() before creating a cache.");
        }
        try
        {
            net.sf.ehcache.Cache cache = manager.getCache(name);
            if (cache == null)
            {
                log.warn("Could not find a specific ehcache configuration for cache named [" + name
                        + "]; using defaults.");
                manager.addCache(name);
                cache = manager.getCache(name);
            }
            Ehcache backingCache = cache;
            if (!backingCache.getCacheEventNotificationService().hasCacheEventListeners())
            {
                if (listeners.size() > 0)
                {
                    for (CacheEventListener listener : listeners)
                    {
                        if (!backingCache.getCacheEventNotificationService().getCacheEventListeners()
                                .contains(listener))
                        {
                            backingCache.getCacheEventNotificationService().registerListener(listener);
                        }
                    }
                }
            }

            this.cache = new EhCacheWrapper(cache);
            return this.cache;
        }
        catch (net.sf.ehcache.CacheException e)
        {
            throw new CacheException("Could not create cache: " + name, e);
        }

    }
View Full Code Here

TOP

Related Classes of com.impetus.kundera.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.