Package railo.runtime.config

Examples of railo.runtime.config.ConfigWeb


    }
 
  protected Object toCFMLObject(ASObject aso) throws PageException {
    if(!StringUtil.isEmpty(aso.getType())){
      PageContext pc = ThreadLocalPageContext.get();
      ConfigWeb config = pc.getConfig();
     
        String name="/"+aso.getType().replace('.', '/')+".cfc";

        Page p = PageSourceImpl.loadPage(pc, ((PageContextImpl)pc).getPageSources(name), null) ;

        if(p==null)throw new ApplicationException("Could not find a Component with name ["+aso.getType()+"]");
       
        Component cfc = ComponentLoader.loadComponent(pc, p, p.getPageSource(), aso.getType(), false);
        ComponentWrap cw=ComponentWrap.toComponentWrap(config.getComponentDataMemberDefaultAccess(),cfc);
       
        Iterator it = aso.entrySet().iterator();
        Map.Entry entry;
        while(it.hasNext()){
          entry = (Entry) it.next();
View Full Code Here


  public static Struct call(PageContext pc ) throws PageException {
    Struct sct=new StructImpl();
      Struct web=new StructImpl();
      Struct server=new StructImpl();
      ConfigWeb config = pc.getConfig();
     
    web.set(SECURITY_KEY, ((ConfigImpl)config).getSecurityKey());
    web.set(KeyConstants._id, config.getId());
    sct.set(KeyConstants._web, web);
     
      if(config instanceof ConfigWebImpl){
        ConfigWebImpl cwi = (ConfigWebImpl)config;
        server.set(SECURITY_KEY, cwi.getServerSecurityKey());
View Full Code Here

  private static final Key USERS = KeyImpl.init("users");
  private static final Key QUERIES = KeyImpl.init("queries");
  private static final Key LOCKS = KeyImpl.init("locks");
 
  public static Struct call(PageContext pc) throws PageException  {
    ConfigWeb cw = pc.getConfig();
    ConfigServer cs = cw.getConfigServer("server");
    ConfigWeb[] webs = cs.getConfigWebs();
    CFMLEngineFactory.getInstance();
    CFMLEngineImpl engine = (CFMLEngineImpl) cs.getCFMLEngine();
   
    Struct sct=new StructImpl();
View Full Code Here

    try {
        boolean isRunning=cfmlFactory.getUsedPageContextLength()>0;  
          if(isRunning) {
          cfmlFactory.checkTimeout();
          }
        ConfigWeb config = null;
       
        if(firstRun) {
          config = cfmlFactory.getConfig();
          ThreadLocalConfig.register(config);
         
          config.reloadTimeServerOffset();
          checkOldClientFile(config);
         
          //try{checkStorageScopeFile(config,Session.SCOPE_CLIENT);}catch(Throwable t){}
          //try{checkStorageScopeFile(config,Session.SCOPE_SESSION);}catch(Throwable t){}
          try{config.reloadTimeServerOffset();}catch(Throwable t){}
          try{checkTempDirectorySize(config);}catch(Throwable t){}
          try{checkCacheFileSize(config);}catch(Throwable t){}
          try{cfmlFactory.getScopeContext().clearUnused();}catch(Throwable t){}
        }
       
        if(config==null) {
          config = cfmlFactory.getConfig();
          ThreadLocalConfig.register(config);
        }
       
       
        //every Minute
        if(doMinute) {
          if(config==null) {
            config = cfmlFactory.getConfig();
            ThreadLocalConfig.register(config);
          }
         
          // deploy extensions, archives ...
          try{DeployHandler.deploy(config);}catch(Throwable t){t.printStackTrace();}
         
          // clear unused DB Connections
          try{((ConfigImpl)config).getDatasourceConnectionPool().clear();}catch(Throwable t){}
          // clear all unused scopes
          try{cfmlFactory.getScopeContext().clearUnused();}catch(Throwable t){}
          // Memory usage
          // clear Query Cache
          try{cfmlFactory.getDefaultQueryCache().clearUnused(null);}catch(Throwable t){}
          // contract Page Pool
          //try{doClearPagePools((ConfigWebImpl) config);}catch(Throwable t){}
          //try{checkPermGenSpace((ConfigWebImpl) config);}catch(Throwable t){}
          try{doCheckMappings(config);}catch(Throwable t){}
          try{doClearMailConnections();}catch(Throwable t){}
          // clean LockManager
          if(cfmlFactory.getUsedPageContextLength()==0)try{((LockManagerImpl)config.getLockManager()).clean();}catch(Throwable t){}
         
          try{ConfigWebAdmin.checkForChangesInConfigFile(config);}catch(Throwable t){}
               
        }
        // every hour
        if(doHour) {
          if(config==null) {
            config = cfmlFactory.getConfig();
            ThreadLocalConfig.register(config);
          }
          // time server offset
          try{config.reloadTimeServerOffset();}catch(Throwable t){}
          // check file based client/session scope
          //try{checkStorageScopeFile(config,Session.SCOPE_CLIENT);}catch(Throwable t){}
          //try{checkStorageScopeFile(config,Session.SCOPE_SESSION);}catch(Throwable t){}
          // check temp directory
          try{checkTempDirectorySize(config);}catch(Throwable t){}
View Full Code Here

**/
public final class Module extends CFTag {

  @Override
  public void initFile() throws MissingIncludeException, ExpressionException {
    ConfigWeb config = pageContext.getConfig();
        // MUSTMUST cache like ct
    //String[] filenames=getFileNames(config,getAppendix());// = appendix+'.'+config.getCFMLExtension();
       
      Object objTemplate =attributesScope.get(KeyConstants._template,null);
      Object objName =attributesScope.get(KeyConstants._name,null);
      source=null;
      if(objTemplate!=null) {
      attributesScope.removeEL(KeyConstants._template);
        String template=objTemplate.toString();

            if(StringUtil.startsWith(template,'/'))  {
              PageSource[] sources = ((PageContextImpl)pageContext).getPageSources(template);
              PageSource ps = MappingImpl.isOK(sources);
             
              if(ps==null)
          throw new MissingIncludeException(sources[0],"could not find template ["+template+"], file ["+sources[0].getDisplayPath()+"] doesn't exist");
              source=new InitFile(ps,template,template.endsWith('.'+pageContext.getConfig().getCFCExtension()));
            }
            else {
              source=new InitFile(pageContext.getCurrentPageSource().getRealPage(template),template,StringUtil.endsWithIgnoreCase(template,'.'+pageContext.getConfig().getCFCExtension()));
              if(!MappingImpl.isOK(source.getPageSource())){
          throw new MissingIncludeException(source.getPageSource(),"could not find template ["+template+"], file ["+source.getPageSource().getDisplayPath()+"] doesn't exist");
              }
            }
       
            //attributesScope.removeEL(TEMPLATE);
            setAppendix(source.getPageSource());
      }
      else if(objName!=null) {
      attributesScope.removeEL(KeyConstants._name);
          String[] filenames = toRealPath(config,objName.toString());
          boolean exist=false;
         
          // appcontext mappings
          Mapping[] ctms = pageContext.getApplicationContext().getCustomTagMappings();
          if(ctms!=null) {
            outer:for(int f=0;f<filenames.length;f++){
              for(int i=0;i<ctms.length;i++){
                  source=new InitFile(ctms[i].getPageSource(filenames[f]),filenames[f],filenames[f].endsWith('.'+config.getCFCExtension()));
                  if(MappingImpl.isOK(source.getPageSource())) {
                    exist=true;
                    break outer;
                  }
                }
            }
          }
         
          // config mappings
          if(!exist) {
            ctms = config.getCustomTagMappings();
            outer:for(int f=0;f<filenames.length;f++){
                for(int i=0;i<ctms.length;i++){// TODO optimieren siehe CFTag
                  source=new InitFile(ctms[i].getPageSource(filenames[f]),filenames[f],filenames[f].endsWith('.'+config.getCFCExtension()));
                  if(MappingImpl.isOK(source.getPageSource())) {
                    exist=true;
                    break outer;
                  }
                }
View Full Code Here

    }

  public void serviceFile(HttpServlet servlet, HttpServletRequest req, HttpServletResponse rsp) throws ServletException, IOException {
    req=new HTTPServletRequestWrap(req);
    CFMLFactory factory=getCFMLFactory(servlet.getServletContext(), servlet.getServletConfig(), req);
        ConfigWeb config = factory.getConfig();
        PageSource ps = config.getPageSourceExisting(null, null, req.getServletPath(), false, true, true, false);
        //Resource res = ((ConfigWebImpl)config).getPhysicalResourceExistingX(null, null, req.getServletPath(), false, true, true);
       
    if(ps==null) {
        rsp.sendError(404);
      }
View Full Code Here

    InitFile initFile = loadInitFile(pc, name, null);
    if(initFile!=null) {
        return initFile;
      }
       // EXCEPTION
      ConfigWeb config = pc.getConfig();
        // message
        StringBuffer msg=new StringBuffer("custom tag \"");
        msg.append(getDisplayName(config,name));
        msg.append("\" is not defined in directory \"");
        msg.append(ResourceUtil.getResource(pc, pc.getCurrentPageSource()).getParent());
        msg.append('"');
       
        Mapping[] actms = pc.getApplicationContext().getCustomTagMappings();
        Mapping[] cctms = config.getCustomTagMappings();
        int asize=ArrayUtil.size(actms);
        int csize=ArrayUtil.size(cctms);
        int size=asize+csize;
       
        if(size>0){
View Full Code Here

TOP

Related Classes of railo.runtime.config.ConfigWeb

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.