Package javax.util.jcache

Examples of javax.util.jcache.CacheException


      if(acc.isPresent(key)) {
      prev = acc.get(key);
      }
      boolean success = acc.put(key, value);
      if(!success) {
          CacheException ex = acc.getException(true);
          if(ex instanceof CacheFullException) {
              throw new IllegalArgumentException(ex.getMessage());
          }
          if(ex!=null) {
              throw new IllegalStateException(ex.getMessage());
          }
          throw new IllegalStateException("Unknown error.");
      }
        return prev;
    }
View Full Code Here


    public CacheException getException(boolean cached) {
        if (lastException == null) {
            return null;
        }
        try {
            CacheException ex = (CacheException) lastException.newInstance();
            ex.setMessage(lastMessage);
            this.lastException = null;
            this.lastMessage = null;
            return ex;
        } catch (InstantiationException e) {
            throw new IllegalStateException(e.getMessage() + ":" + lastMessage);
View Full Code Here

     */
    private CacheLogger parseLogger(final String logger) throws CacheException {
        try {
            return (CacheLogger) Class.forName(logger).newInstance();
        } catch (ClassNotFoundException e) {
            throw new CacheException("The CacheLogger " + logger + " could not be found.");
        } catch (InstantiationException e) {
            throw new CacheException("The CacheLogger " + logger + " could not be loaded.");
        } catch (IllegalAccessException e) {
            throw new CacheException("The CacheLogger " + logger + " is appearently not a CacheLogger.");
        }
    }
View Full Code Here

TOP

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