Package railo.runtime.config

Examples of railo.runtime.config.ConfigImpl


    }
    catch (Throwable t) {
      if(!Abort.isSilentAbort(t)) {
        ConfigWeb c = pc.getConfig();
        if(c instanceof ConfigImpl) {
          ConfigImpl ci=(ConfigImpl) c;
          LogAndSource log = ci.getThreadLogger();
          if(log!=null)log.error(this.getName(), ExceptionUtil.getStacktrace(t,true));
        }
        PageException pe = Caster.toPageException(t);
        if(!serializable)catchBlock=pe.getCatchBlock(pc);
        return pe;
View Full Code Here


  public static String call(PageContext pc, String strType) throws PageException {
    int type = Util.toType(strType,ConfigImpl.CACHE_DEFAULT_NONE);
    if(type==ConfigImpl.CACHE_DEFAULT_NONE)
      throw new FunctionException(pc,"CacheGetDefaultCacheName",1,"type","invalid type defintion ["+strType+"], valid types are [object,resource,template,query]");
   
    ConfigImpl config=(ConfigImpl) pc.getConfig();
    CacheConnection conn = config.getCacheDefaultConnection(type);
    if(conn==null)
      throw new ExpressionException("there is no default cache defined for type ["+strType+"]");
   
    return conn.getName();
  }
View Full Code Here

  private static void setProperties(CacheConnection cc, Struct properties) throws SecurityException {
    throw new SecurityException("it is not allowed to change cache connection setting this way, please use the tag cfadmin or the railo administrator frontend instead ");
  }

  private static CacheConnection[] getCaches(PageContext pc,String cacheName) throws CacheException {
    ConfigImpl config=(ConfigImpl) pc.getConfig();
    if(StringUtil.isEmpty(cacheName)){
     
      return new CacheConnection[]{
          config.getCacheDefaultConnection(ConfigImpl.CACHE_DEFAULT_OBJECT),
          config.getCacheDefaultConnection(ConfigImpl.CACHE_DEFAULT_TEMPLATE)
      }
      ;
      // MUST which one is first
    }
   
    ArrayList<CacheConnection> list=new ArrayList<CacheConnection>();
    String name;
    String[] names=ListUtil.listToStringArray(cacheName, ',');
    for(int i=0;i<names.length;i++){
      name=names[i].trim().toLowerCase();
      if(name.equalsIgnoreCase("template"))
        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 static void setORMConfiguration(PageContext pc, ApplicationContext ac,Struct sct) throws PageException {
    if(sct==null)sct=new StructImpl();
    Resource res=pc.getCurrentTemplatePageSource().getResourceTranslated(pc).getParentResource();
    ConfigImpl config=(ConfigImpl) pc.getConfig();
    ac.setORMConfiguration(ORMConfigurationImpl.load(config,ac,sct,res,config.getORMConfig()));
   
    // datasource
    Object o = sct.get(KeyConstants._datasource,null);
    if(o!=null) ac.setORMDatasource(Caster.toString(o));
  }
View Full Code Here

   


  private void doGetLoginSettings() throws ApplicationException, PageException {
    Struct sct=new StructImpl();
    ConfigImpl c = (ConfigImpl) ThreadLocalPageContext.getConfig(config);
        pageContext.setVariable(getString("admin",action,"returnVariable"),sct);
        sct.set("captcha",Caster.toBoolean(c.getLoginCaptcha()));
        sct.set("delay",Caster.toDouble(c.getLoginDelay()));
       
  }
View Full Code Here

      files.put(zipFile.getPath(), compress);
    }
    return compress;ConfigImpl
  }*/
  public static Compress getInstance(Resource zipFile, int format, boolean caseSensitive) {
    ConfigImpl config=(ConfigImpl) ThreadLocalPageContext.getConfig();
    return config.getCompressInstance(zipFile, format, caseSensitive);
  }
View Full Code Here

import railo.runtime.PageContext;
import railo.runtime.config.ConfigImpl;

public class ComponentCacheClear {
  public static String call(PageContext pc) {
    ConfigImpl config = (ConfigImpl)pc.getConfig();
    config.clearComponentCache();
    return null;
  }
View Full Code Here

import railo.runtime.config.ConfigImpl;
import railo.runtime.type.Struct;

public class ComponentCacheList {
  public static Struct call(PageContext pc) {
    ConfigImpl config = (ConfigImpl)pc.getConfig();
    return config.listComponentCache();
  }
View Full Code Here

import railo.runtime.config.ConfigImpl;
import railo.runtime.type.Struct;

public class CTCacheList {
  public static Struct call(PageContext pc) {
    ConfigImpl config = (ConfigImpl)pc.getConfig();
    return config.listCTCache();
  }
View Full Code Here

import railo.runtime.PageContext;
import railo.runtime.config.ConfigImpl;

public class CTCacheClear {
  public static String call(PageContext pc) {
    ConfigImpl config = (ConfigImpl)pc.getConfig();
    config.clearCTCache();
    return null;
  }
View Full Code Here

TOP

Related Classes of railo.runtime.config.ConfigImpl

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.