Package railo.runtime

Examples of railo.runtime.PageContextImpl


    private static boolean terminateRunningThread(ConfigWeb configWeb,int id) {

      Struct pcs = ((CFMLFactoryImpl)configWeb.getFactory()).getRunningPageContexts();
       
        Iterator it = pcs.keyIterator();
        PageContextImpl pc;
        Collection.Key key;
        while(it.hasNext()) {
          key=KeyImpl.toKey(it.next(),null);
            pc=(PageContextImpl) pcs.get(key,null);
            if(pc.getId()==id){
              CFMLFactoryImpl.terminate(pc);
              return true;
            }
        }
        return false;
View Full Code Here


public final class GetFunctionCalledName implements Function {

  private static final long serialVersionUID = -3345605395096765821L;

  public static String call(PageContext pc) {
    PageContextImpl pci=(PageContextImpl) pc;
    Key name = pci.getActiveUDFCalledName();
    if(name!=null) return name.getString();
   
    UDF[] udfs = ((PageContextImpl)pc).getUDFs();
    if(udfs.length==0) return "";
    return udfs[udfs.length-1].getFunctionName();
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++){
              if(sources[i].exists()) {
View Full Code Here

    return access;
  }

  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));
     
    }
View Full Code Here

  }

 
  @Override
  public Object callWithNamedValues(PageContext pc, Key calledName, Struct values, boolean doIncludePath) throws PageException {
    PageContextImpl pci = ((PageContextImpl)pc);
    Key old =pci.getActiveUDFCalledName();
    pci.setActiveUDFCalledName(calledName);
    try{
      return callWithNamedValues(pci, values, doIncludePath);
    }
    finally{
      pci.setActiveUDFCalledName(old);
    }
  }
View Full Code Here

    }
  }

  @Override
  public Object call(PageContext pc, Key calledName, Object[] args, boolean doIncludePath) throws PageException {
    PageContextImpl pci = ((PageContextImpl)pc);
    Key old =pci.getActiveUDFCalledName();
    pci.setActiveUDFCalledName(calledName);
    try{
      return call(pci, args, doIncludePath);
    }
    finally{
      pci.setActiveUDFCalledName(old);
    }
  }
View Full Code Here

            }
      }
     
      // Undefined Scope
      else if(objs[objs.length-1] instanceof Undefined) {
        PageContextImpl pci=(PageContextImpl) pc;
        Undefined undefined=(Undefined) objs[objs.length-1];
       
        boolean check=undefined.getCheckArguments();
        Variables orgVar=pc.variablesScope();
        Argument orgArgs=pc.argumentsScope();
            Local orgLocal=pc.localScope();
       
        pci.setVariablesScope(undefined.variablesScope());
        if(check)pci.setFunctionScopes(undefined.localScope(), undefined.argumentsScope());
            try{
              return _call(pc, objs,objs.length-1,preciseMath);
            }
            finally{
              pc.setVariablesScope(orgVar);
              if(check)pci.setFunctionScopes(orgLocal,orgArgs);
            }
       
      }
    }
    return _call(pc,objs,objs.length,preciseMath);
View Full Code Here

      clazz=tag.getClazz();
    }
    catch(Throwable t){}
   
    if(clazz==CFTagCore.class){
      PageContextImpl pci=(PageContextImpl) pc;
      boolean prior = pci.useSpecialMappings(true);
      try{
        return cfmlBasedTag(pc,tld,tag);
      }
      finally {
        pci.useSpecialMappings(prior);
      }
     
    }
    return javaBasedTag(tld,tag);
   
View Full Code Here

    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");
          }
View Full Code Here

    }
 
  
    public static Object doJava(PageContext pc,String className, String pathes, String delimiter) throws PageException {
        if(pc.getConfig().getSecurityManager().getAccess(SecurityManager.TYPE_DIRECT_JAVA_ACCESS)==SecurityManager.VALUE_YES) {
          PageContextImpl pci = (PageContextImpl)pc;
          java.util.List<Resource> resources=new ArrayList<Resource>();
         
          // get java settings from application.cfc
          //java.util.List<Resource> resources=getJavaSettings(pc);
         
          // load resources
          //Resource[] reses=null;
          if(!StringUtil.isEmpty(pathes, true)) {
            if(StringUtil.isEmpty(delimiter))delimiter=",";
            String[] arrPathes = ListUtil.trimItems(ListUtil.toStringArray(ListUtil.listToArrayRemoveEmpty(pathes.trim(),delimiter)));
           
            for(int i=0;i<arrPathes.length;i++) {
              resources.add(ResourceUtil.toResourceExisting(pc,arrPathes[i]));
            }
          }
         
          // load class
          try  {
            ClassLoader cl = resources.size()==0?pci.getClassLoader():pci.getClassLoader(resources.toArray(new Resource[resources.size()]));
            Class clazz=null;
            try{
            clazz = ClassUtil.loadClass(cl,className);
          }
          catch(ClassException ce) {
View Full Code Here

TOP

Related Classes of railo.runtime.PageContextImpl

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.