Package net.sf.ehcache

Examples of net.sf.ehcache.CacheException


   
    static CacheManager createCacheManager() throws CacheException {
        try {
            return (CacheManager)cacheManagerCreateMethodNoArg.invoke(null, (Object[])null);
        } catch (Exception e) {
            throw new CacheException(e);
        }
    }
View Full Code Here


    static CacheManager createCacheManager(URL url) throws CacheException {
        try {
            return (CacheManager)createMethodURLArg.invoke(null, new Object[]{url});
        } catch (Exception e) {
            throw new CacheException(e);
        }
    }
View Full Code Here

    static CacheManager createCacheManager(Configuration conf) throws CacheException {
        try {
            return (CacheManager)cacheManagerCreateMethodConfigurationArg.invoke(null, new Object[]{conf});
        } catch (Exception e) {
            throw new CacheException(e);
        }
    }
View Full Code Here

            pointer = directMemoryCache.put( element.getObjectKey(), element );
        }
        catch ( BufferOverflowException boe )
        {
            dump();
            throw new CacheException( "DirectMemory OffHeap Memory Exceeded", boe );
        }
        return null == pointer ? false : true;
    }
View Full Code Here

            }
        }
        catch ( BufferOverflowException boe )
        {
            dump();
            throw new CacheException( "DirectMemory OffHeap Memory Exceeded", boe );
        }
        finally
        {
            lock.unlock();
        }
View Full Code Here

            }
        }
        catch ( BufferOverflowException boe )
        {
            dump();
            throw new CacheException( "DirectMemory OffHeap Memory Exceeded", boe );
        }
        finally
        {
            lock.unlock();
        }
View Full Code Here

  }
 
  protected Ehcache getCache() {
     Ehcache cache = getCacheManager().getEhcache(cacheName);
         if (cache == null) {
             throw new CacheException("cache '" + cacheName
                     + "' not found in configuration");
         }
         if (!(cache instanceof BlockingCache)) {
             // decorate and substitute
             BlockingCache newBlockingCache = new BlockingCache(cache);
View Full Code Here

        String key = exchange.getIn().getHeader(CacheConstants.CACHE_KEY, String.class);
        String operation = exchange.getIn().getHeader(CacheConstants.CACHE_OPERATION, String.class);

        if (operation == null) {
            throw new CacheException("Operation not specified in the message header [" + CacheConstants.CACHE_KEY + "]");
        }
        if ((key == null) && (!operation.equalsIgnoreCase(CacheConstants.CACHE_OPERATION_DELETEALL))) {
            throw new CacheException("Cache Key is not specified in message header header or endpoint URL.");
        }

        performCacheOperation(exchange, operation, key);
    }
View Full Code Here

                exchange.getIn().setHeader(CacheConstants.CACHE_ELEMENT_WAS_FOUND, true);
            } else {
                exchange.getIn().removeHeader(CacheConstants.CACHE_ELEMENT_WAS_FOUND);
            }
        } else {
            throw new CacheException("Operation " + operation + " is not supported.");
        }
    }
View Full Code Here

    private Object createElementFromBody(Exchange exchange, String cacheOperation) throws NoTypeConversionAvailableException {
        Object element;
        Object body = exchange.getIn().getBody();
        if (body == null) {
            throw new CacheException("Body cannot be null for operation " + cacheOperation);
        } else if (body instanceof Serializable) {
            element = body;
        } else {
            InputStream is = exchange.getContext().getTypeConverter().mandatoryConvertTo(InputStream.class, body);
            // Read InputStream into a byte[] buffer
View Full Code Here

TOP

Related Classes of net.sf.ehcache.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.