Examples of CFMLFactoryImpl


Examples of railo.runtime.CFMLFactoryImpl

  private static final long serialVersionUID = -3868545140988347285L;

  @Override
  public void doEnd(StorageScopeEngine engine,StorageScopeCleaner cleaner,String appName, String cfid) {
    CFMLFactoryImpl factory = engine.getFactory();
    ApplicationListener listener = factory.getConfig().getApplicationListener();
    try {
      cleaner.info("call onSessionEnd for "+appName+"/"+cfid);
      listener.onSessionEnd(factory, appName, cfid);
    }
    catch (Throwable t) {
      ExceptionHandler.log(factory.getConfig(),Caster.toPageException(t));
    }
  }
View Full Code Here

Examples of railo.runtime.CFMLFactoryImpl

public class ThreadUtil {
 

  public static  PageContextImpl clonePageContext(PageContext pc, OutputStream os, boolean stateless,boolean registerPC,boolean isChild)  {
    // TODO stateless
    CFMLFactoryImpl factory = (CFMLFactoryImpl) ((ConfigImpl)pc.getConfig()).getFactory();
        HttpServletRequest  req=new HTTPServletRequestWrap(cloneHttpServletRequest(pc));
        HttpServletResponse  rsp=createHttpServletResponse(os);
       
        // copy state
        PageContextImpl pci = (PageContextImpl) pc;
    PageContextImpl dest = factory.getPageContextImpl(factory.getServlet(), req, rsp, null, false, -1, false,registerPC, isChild);
    pci.copyStateTo(dest);
    return dest;
  }
View Full Code Here

Examples of railo.runtime.CFMLFactoryImpl

  public void clearApplication(PageContext pc) throws PageException {
       
        if(applicationContextes.size()==0) throw new ApplicationException("there is no application context defined");
   
        String name = pc.getApplicationContext().getName();
        CFMLFactoryImpl jspFactory = (CFMLFactoryImpl)pc.getCFMLFactory();
   
        Application application=applicationContextes.get(name);
        if(application==null) throw new ApplicationException("there is no application context defined with name ["+name+"]");
        ApplicationListener listener = PageContextUtil.getApplicationListener(pc);
        application.touch();
View Full Code Here

Examples of railo.runtime.CFMLFactoryImpl

import railo.runtime.exp.PageException;
import railo.runtime.type.scope.ScopeContext;

public class ApplicationStop {
  public static String call(PageContext pc) throws PageException {
    CFMLFactoryImpl factory = (CFMLFactoryImpl)pc.getCFMLFactory();
    ScopeContext sc = factory.getScopeContext();
    sc.clearApplication(pc);
    return null;
  }
View Full Code Here

Examples of railo.runtime.CFMLFactoryImpl

    // 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);
      getAllCFSessionScopes(web,factory.getScopeContext(),sess);
     
     
    }
   
    // Datasource
View Full Code Here

Examples of railo.runtime.CFMLFactoryImpl

              factories.length,getString("admin",action,"returnVariable"));
        pageContext.setVariable(getString("admin",action,"returnVariable"),qry);
        ConfigWebImpl cw;
        for(int i=0;i<factories.length;i++) {
          int row=i+1;
            CFMLFactoryImpl factory = (CFMLFactoryImpl) factories[i];
            cw = (ConfigWebImpl) factory.getConfig();
            qry.setAtEL(KeyConstants._path,row,ReqRspUtil.getRootPath(factory.getConfigWebImpl().getServletContext()));
           
            qry.setAtEL(CONFIG_FILE,row,factory.getConfigWebImpl().getConfigFile().getAbsolutePath());
            if(factory.getURL()!=null)qry.setAtEL(KeyConstants._url,row,factory.getURL().toExternalForm());
           

            qry.setAtEL(KeyConstants._id,row,factory.getConfig().getId());
            qry.setAtEL(KeyConstants._hash,row,SystemUtil.hash(factory.getConfigWebImpl().getServletContext()));
            qry.setAtEL(KeyConstants._label,row,factory.getLabel());
            qry.setAtEL(HAS_OWN_SEC_CONTEXT,row,Caster.toBoolean(cw.hasIndividualSecurityManager()));

            setScopeDirInfo(qry,row,CLIENT_SIZE,CLIENT_ELEMENTS,cw.getClientScopeDir());
            setScopeDirInfo(qry,row,SESSION_SIZE,SESSION_ELEMENTS,cw.getSessionScopeDir());
        }
View Full Code Here

Examples of railo.runtime.CFMLFactoryImpl

        }
        pageContext.setVariable(getString("admin",action,"returnVariable"),qry);
    }
   
    private static void fillGetRunningThreads(railo.runtime.type.Query qry, ConfigWeb configWeb) throws PageException {
      CFMLFactoryImpl factory = ((CFMLFactoryImpl)configWeb.getFactory());
      Struct pcs =factory.getRunningPageContexts();
      Iterator it = pcs.keyIterator();
        PageContextImpl pc;
        Collection.Key key;
        int row=0;
        while(it.hasNext()) {
          key=KeyImpl.toKey(it.next(),null);
            pc=(PageContextImpl) pcs.get(key,null);
            qry.addRow();
            row++;
            StackTraceElement[] st = pc.getThread().getStackTrace();
            configWeb.getConfigDir();
            configWeb.getId();
            configWeb.getConfigDir();
            qry.setAt("Id",row,new Double(pc.getId()));
            qry.setAt("Start",row,new DateTimeImpl(pc.getStartTime(),false));
            qry.setAt("Timeout",row,new Double(pc.getRequestTimeout()/1000));
            qry.setAt("ThreadType",row,pc.getParentPageContext()==null?"main":"child");
            qry.setAt("StackTrace",row,toString(st));
            qry.setAt("TagContext",row,PageExceptionImpl.getTagContext(pc.getConfig(), st));
           
            qry.setAt("label",row,factory.getLabel());
            qry.setAt("RootPath",row,ReqRspUtil.getRootPath(((ConfigWebImpl)configWeb).getServletContext()));
            qry.setAt("ConfigFile",row,configWeb.getConfigFile().getAbsolutePath());
            if(factory.getURL()!=null)qry.setAt("url",row,factory.getURL().toExternalForm());
           
        }
       
  }
View Full Code Here

Examples of railo.runtime.CFMLFactoryImpl

      pageContext.setVariable(getString("admin",action,"returnVariable"),sct);
     
    }
    // Web
    else {
      CFMLFactoryImpl factory = (CFMLFactoryImpl) config.getFactory();
      pageContext.setVariable(getString("admin",action,"returnVariable"),
          factory.getInfo());
    }
  }
View Full Code Here

Examples of railo.runtime.CFMLFactoryImpl

            // Load Config
        RefBoolean isCustomSetting=new RefBooleanImpl();
            Resource configDir=getConfigDirectory(sg,configServer,countExistingContextes,isCustomSetting);
           
            QueryCacheSupport queryCache=QueryCacheSupport.getInstance();
            CFMLFactoryImpl factory=new CFMLFactoryImpl(this,queryCache);
            ConfigWebImpl config=ConfigWebFactory.newInstance(factory,configServer,configDir,isCustomSetting.toBooleanValue(),sg);
            factory.setConfig(config);
            return factory;
        }
        catch (Exception e) {
            ServletException se= new ServletException(e.getMessage());
            se.setStackTrace(e.getStackTrace());
View Full Code Here

Examples of railo.runtime.CFMLFactoryImpl

      String real=ReqRspUtil.getRootPath(srvContext);
        ConfigServerImpl cs = getConfigServerImpl();
     
       
        // Load JspFactory
        CFMLFactoryImpl factory=null;
        Object o=contextes.get(real);
        if(o==null) {
            //int size=sn.getContextCount();
            //if(size!=-1 && size <= contextes.size())
                //throw new ServletException("the maximum size of "+size+" web contextes is reached, " +"to have more contexes upgrade your railo version, already contextes in use are ["+getContextList()+"]");
            o=initContextes.get(real);
            if(o!=null) {
                factory=(CFMLFactoryImpl) o;
            }
            else {
                factory=loadJSPFactory(cs,srvConfig,initContextes.size());
                initContextes.put(real,factory);
            }
            contextes.put(real,factory);
           
            try {
              String cp = req.getContextPath();
              if(cp==null)cp="";
        factory.setURL(new URL(req.getScheme(),req.getServerName(),req.getServerPort(),cp));
      }
            catch (MalformedURLException e) {
        e.printStackTrace();
      }
            //
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.