Package railo.runtime.config

Examples of railo.runtime.config.ConfigWebImpl


   
   
    ConfigServer cs=(ConfigServer) config;
    ConfigWeb[] webs = cs.getConfigWebs();
    for(int i=0;i<webs.length;i++){
      ConfigWebImpl cw=(ConfigWebImpl) webs[i];
      if(!cw.getId().equals(contextId)) continue;
       ((CFMLFactoryImpl)cw.getFactory()).stopThread(threadId,stopType);
       break;
       
    }
  }
View Full Code Here


  public static String call(PageContext pc , String dirPath,String webAdminPassword) throws PageException {
    webAdminPassword=getPassword(pc, webAdminPassword);
     
    Resource dir=RestDeleteApplication.toResource(pc,dirPath);
    ConfigWebImpl config=(ConfigWebImpl) pc.getConfig();

    try {
      ConfigWebAdmin admin = ConfigWebAdmin.newInstance((ConfigWebImpl)pc.getConfig(),webAdminPassword);
      Mapping[] mappings = config.getRestMappings();
      Mapping mapping;
      for(int i=0;i<mappings.length;i++){
        mapping=mappings[i];
        if(RestUtil.isMatch(pc,mapping,dir)){
          admin.removeRestMapping(mapping.getVirtual());
View Full Code Here

    if(StringUtil.isEmpty(serviceMapping,true)){
      serviceMapping=pc.getApplicationContext().getName();
    }
    Resource dir=RestDeleteApplication.toResource(pc,dirPath);
   
    ConfigWebImpl config=(ConfigWebImpl) pc.getConfig();
    Mapping[] mappings = config.getRestMappings();
    Mapping mapping;
   
    // id is mapping name
   
    String virtual=serviceMapping.trim();
View Full Code Here

   
    return ((UDFPlus)udf).callWithNamedValues(pc,name, namedArguments, false);
  }

  public static synchronized UDF loadUDF(PageContext pc, String filename,Collection.Key name,boolean isweb) throws PageException {
    ConfigWebImpl config = (ConfigWebImpl) pc.getConfig();
    String key=isweb?name.getString()+config.getId():name.getString();
      UDF udf=config.getFromFunctionCache(key);
    if(udf!=null) return udf;
   
    Mapping mapping=isweb?config.getFunctionMapping():config.getServerFunctionMapping();
      PageSourceImpl ps = (PageSourceImpl) mapping.getPageSource(filename);
      Page p = ps.loadPage(pc)
   
     
      // execute page
      Variables old = pc.variablesScope();
      pc.setVariablesScope(VAR);
      boolean wasSilent = pc.setSilent();
      try {
      p.call(pc);
      Object o= pc.variablesScope().get(name,null);
      if(o instanceof UDF) {
        udf= (UDF) o;
        config.putToFunctionCache(key, udf);
        return udf;
      }
      throw new ExpressionException("there is no Function defined with name ["+name+"] in template ["+mapping.getStrPhysical()+File.separator+filename+"]");
    }
      catch (Throwable t) {
View Full Code Here

import railo.runtime.ext.function.Function;

public final class PagePoolClear implements Function {
 
  public static boolean call(PageContext pc) {
    ConfigWebImpl config=(ConfigWebImpl) pc.getConfig();
    clear(config.getMappings());
    clear(config.getCustomTagMappings());
    clear(pc.getApplicationContext().getMappings());
    clear(config.getComponentMappings());
    clear(config.getFunctionMapping());
    clear(config.getServerFunctionMapping());
    clear(config.getTagMapping());
    clear(config.getServerTagMapping());
     
    return true;
  }
View Full Code Here

        Resource res;
       
        if(StringUtil.startsWith(realPath,'/')) {
          PageContextImpl pci=(PageContextImpl) pc;
          ConfigWebImpl cwi=(ConfigWebImpl) config;
          PageSource[] sources = cwi.getPageSources(pci, pc.getApplicationContext().getMappings(), realPath,
              false, pci.useSpecialMappings(), true);
         
          if(!ArrayUtil.isEmpty(sources)) {
            // first check for existing
            for(int i=0;i<sources.length;i++){
View Full Code Here

    // Locks
    Query lck=new QueryImpl(new Collection.Key[]{KeyConstants._web,KeyConstants._application,KeyConstants._name,START_TIME,KeyConstants._timeout,KeyConstants._type}, 0, "requests");
    sct.setEL(LOCKS, lck);

    // Loop webs
    ConfigWebImpl web;
    Struct pcs;
    PageContextImpl _pc;
    int row,openConnections=0;
    CFMLFactoryImpl factory;
    ActiveQuery[] queries;
    ActiveQuery aq;
    ActiveLock[] locks;
    ActiveLock al;
    for(int i=0;i<webs.length;i++){
     
      // Loop requests
      web=(ConfigWebImpl) webs[i];
      factory=(CFMLFactoryImpl)web.getFactory();
      pcs = factory.getRunningPageContexts();
      Iterator<Object> it = pcs.valueIterator();
      while(it.hasNext()){
        _pc = (PageContextImpl) it.next();
        if(_pc.isGatewayContext()) continue;
       
        // Request
        row = req.addRow();
        req.setAt(KeyConstants._web, row, web.getLabel());
        req.setAt(KeyConstants._uri, row, getPath(_pc.getHttpServletRequest()));
        req.setAt(START_TIME, row, new DateTimeImpl(pc.getStartTime(),false));
        req.setAt(KeyConstants._timeout, row, new Double(pc.getRequestTimeout()));
       
        // Query
        queries = _pc.getActiveQueries();
        if(queries!=null) {
          for(int y=0;y<queries.length;y++){
            aq=queries[y];
            row = qry.addRow();
            qry.setAt(KeyConstants._web, row, web.getLabel());
            qry.setAt(KeyConstants._application, row, _pc.getApplicationContext().getName());
            qry.setAt(START_TIME, row, new DateTimeImpl(web,aq.startTime,true));
            qry.setAt(KeyConstants._sql, row, aq.sql);
          }
        }
       
        // Lock
        locks = _pc.getActiveLocks();
        if(locks!=null) {
          for(int y=0;y<locks.length;y++){
            al=locks[y];
            row = lck.addRow();
            lck.setAt(KeyConstants._web, row, web.getLabel());
            lck.setAt(KeyConstants._application, row, _pc.getApplicationContext().getName());
            lck.setAt(KeyConstants._name, row, al.name);
            lck.setAt(START_TIME, row, new DateTimeImpl(web,al.startTime,true));
            lck.setAt(KeyConstants._timeout, row, Caster.toDouble(al.timeoutInMillis/1000));
            lck.setAt(KeyConstants._type, row, al.type==LockManager.TYPE_EXCLUSIVE?"exclusive":"readonly");
          }
        }
      }
      openConnections+=web.getDatasourceConnectionPool().openConnections();


      // Template Cache
      Mapping[] mappings = ConfigImpl.getAllMappings(web);
      long[] tce = templateCacheElements(mappings);
      row = tc.addRow();
      tc.setAt(KeyConstants._web, row, web.getLabel());
      tc.setAt(KeyConstants._size, row, new Double(tce[1]));
      tc.setAt(ELEMENTS, row, new Double(tce[0]));
     
      // Scope Application
      getAllApplicationScopes(web,factory.getScopeContext(),app);
View Full Code Here

    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());
        server.set(KeyConstants._id, cwi.getServerId());
        server.set(ID_PRO, cwi.getServerIdPro());
        sct.set(KeyConstants._server, server);
      }
     
      sct.set(KeyConstants._request, Caster.toString(pc.getId()));
      return  sct;
View Full Code Here

    this.readonly=readonly;
    this._default=_default;
   

        if(!(config instanceof ConfigWebImpl)) return;
        ConfigWebImpl cw=(ConfigWebImpl) config;
   
    this.physical=ConfigWebUtil.getExistingResource(cw.getServletContext(),physical,null,cw.getConfigDir(),FileUtil.TYPE_DIR,cw);
   
  }
View Full Code Here

  }

  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    try {
      PageContextImpl pc = (PageContextImpl) ThreadLocalPageContext.get();
      ConfigWebImpl cw = (ConfigWebImpl) ThreadLocalPageContext.getConfig(pc);
      String path=ExternalizableUtil.readString(in);
      pageSource=PageSourceImpl.best(cw.getPageSources(pc,null, path, false,true,true));
     
    }
    catch (Throwable e) {
      e.printStackTrace();
      throw ExceptionUtil.toIOException(e);
View Full Code Here

TOP

Related Classes of railo.runtime.config.ConfigWebImpl

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.