Package railo.commons.io.cache.exp

Examples of railo.commons.io.cache.exp.CacheException


        list.add(config.getCacheDefaultConnection(ConfigImpl.CACHE_DEFAULT_TEMPLATE));
      else if(name.equalsIgnoreCase("object"))
        list.add(config.getCacheDefaultConnection(ConfigImpl.CACHE_DEFAULT_OBJECT));
      else{
        CacheConnection cc= config.getCacheConnections().get(name);
        if(cc==null) throw new CacheException("there is no cache defined with name ["+name+"]");
        list.add(cc);
      }
    }
    return list.toArray(new CacheConnection[list.size()]);
  }
View Full Code Here


    public CacheConnectionImpl(Config config,String name, Class clazz, Struct custom, boolean readOnly, boolean storage) throws CacheException {
      this.name=name;
      this.clazz=clazz;
      if(!Reflector.isInstaneOf(clazz, Cache.class))
        throw new CacheException("class ["+clazz.getName()+"] does not implement interface ["+Cache.class.getName()+"]");
      this.custom=custom;
      this.readOnly=readOnly;
      this.storage=storage;
    }
View Full Code Here

  }
 
  @Override
  public CacheEntry getCacheEntry(String key) throws IOException {
    CacheEntry entry = getCacheEntry(key, null);
    if(entry==null) throw new CacheException("there is no valid cache entry with key ["+key+"]");
    return entry;
  }
View Full Code Here

    return entry;
  }
 
  public CacheEntry getQuiet(String key) throws IOException {
    CacheEntry entry = getQuiet(key, null);
    if(entry==null) throw new CacheException("there is no valid cache entry with key ["+key+"]");
    return entry;
  }
View Full Code Here

    }
   
    // get default from config
    Config config = ThreadLocalPageContext.getConfig(pc);
    CacheConnection cc= ((ConfigImpl)config).getCacheDefaultConnection(type);
    if(cc==null) throw new CacheException("there is no default "+toStringType(type,"")+" cache defined, you need to define this default cache in the Railo Administrator");
    return cc.getInstance(config);
   
   
  }
View Full Code Here

    while(it.hasNext()){
      sb.append(", ").append(it.next());
    }
    sb.append("]");
   
    return new CacheException(sb.toString());
  }
View Full Code Here

  }


  public void delete(String key,boolean throwWhenNotExists) throws IOException {
    if(!cache.remove(key) && throwWhenNotExists)
      throw new CacheException("there is no entry in cache with key ["+key+"]");
  }
View Full Code Here

  public CacheEntry getCacheEntry(String key) throws CacheException {
    try {
      misses++;
      Element el = getCache().get(key);
      if(el==null)throw new CacheException("there is no entry in cache with key ["+key+"]");
      hits++;
      misses--;
      return new EHCacheEntry(el);
    }
    catch(IllegalStateException ise) {
      throw new CacheException(ise.getMessage());
    }
    catch(net.sf.ehcache.CacheException ce) {
      throw new CacheException(ce.getMessage());
    }
  }
View Full Code Here

  @Override
  public Object getValue(String key) throws CacheException {
    try {
      misses++;
      Element el = getCache().get(key);
      if(el==null)throw new CacheException("there is no entry in cache with key ["+key+"]");
      misses--;
      hits++;
      return el.getObjectValue();
    }
    catch(IllegalStateException ise) {
      throw new CacheException(ise.getMessage());
    }
    catch(net.sf.ehcache.CacheException ce) {
      throw new CacheException(ce.getMessage());
    }
  }
View Full Code Here

  public CacheEntry getCacheEntry(String key) throws CacheException {
    try {
      misses++;
      Element el = getCache().get(key);
      if(el==null)throw new CacheException("there is no entry in cache with key ["+key+"]");
      hits++;
      misses--;
      return new EHCacheEntry(el);
    }
    catch(IllegalStateException ise) {
      throw new CacheException(ise.getMessage());
    }
    catch(net.sf.ehcache.CacheException ce) {
      throw new CacheException(ce.getMessage());
    }
  }
View Full Code Here

TOP

Related Classes of railo.commons.io.cache.exp.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.