001 package railo.runtime.cache; 002 003 import java.io.IOException; 004 005 import railo.commons.io.cache.Cache; 006 import railo.runtime.config.Config; 007 import railo.runtime.config.ConfigServerImpl; 008 import railo.runtime.type.Struct; 009 010 public class ServerCacheConnection implements CacheConnection { 011 012 private CacheConnection cc; 013 private ConfigServerImpl cs; 014 015 /** 016 * Constructor of the class 017 * @param configServer 018 * @param cc 019 */ 020 public ServerCacheConnection(ConfigServerImpl cs, CacheConnection cc) { 021 this.cs=cs; 022 this.cc=cc; 023 } 024 025 /** 026 * @see railo.runtime.cache.CacheConnection#duplicate(railo.runtime.config.Config) 027 */ 028 public CacheConnection duplicate(Config config) throws IOException { 029 return new ServerCacheConnection(cs,cc.duplicate(config)); 030 } 031 032 /** 033 * @see railo.runtime.cache.CacheConnection#getClazz() 034 */ 035 public Class getClazz() { 036 return cc.getClazz(); 037 } 038 039 /** 040 * @see railo.runtime.cache.CacheConnection#getCustom() 041 */ 042 public Struct getCustom() { 043 return cc.getCustom(); 044 } 045 046 /** 047 * @see railo.runtime.cache.CacheConnection#getInstance(railo.runtime.config.Config) 048 */ 049 public Cache getInstance(Config config) throws IOException { 050 return cc.getInstance(cs); 051 } 052 053 public String getName() { 054 return cc.getName(); 055 } 056 057 /** 058 * @see railo.runtime.cache.CacheConnection#isReadOnly() 059 */ 060 public boolean isReadOnly() { 061 return true; 062 } 063 064 /** 065 * @see railo.runtime.cache.CacheConnection#isStorage() 066 */ 067 public boolean isStorage() { 068 return cc.isStorage(); 069 } 070 071 }