Package railo.runtime

Examples of railo.runtime.PageContext


  }

  //private static int pidc=0;
  private int getPid() {
   
    PageContext pc = ThreadLocalPageContext.get();
    if(pc==null) {
      pc=CFMLEngineFactory.getInstance().getThreadPageContext();
      if(pc==null)throw new RuntimeException("cannot get pid for current thread");
    }
    return pc.getId();
  }
View Full Code Here


    DatasourceConnection dc = null;
    ConfigImpl ci = (ConfigImpl)config;
    DatasourceConnectionPool pool = ci.getDatasourceConnectionPool();
    Log log=((ConfigImpl)config).getScopeLogger();
    try {
      PageContext pc = ThreadLocalPageContext.get();// FUTURE change method interface
      DataSource ds;
      if(pc!=null) ds=((PageContextImpl)pc).getDataSource(datasourceName);
      else ds=config.getDataSource(datasourceName);
      dc=pool.getDatasourceConnection(null,ds,null,null);
      SQLExecutor executor=SQLExecutionFactory.getInstance(dc);
View Full Code Here

  public static final String COMPONENT = Component.class.getName();
 
  @Override
  protected Object invokeMethod(MessageContext mc, Method method, Object trg, Object[] args) throws Exception {
    PageContext pc=(PageContext) mc.getProperty(Constants.PAGE_CONTEXT);
    Component c= (Component) mc.getProperty(Constants.COMPONENT);
       
    RPCServer server = RPCServer.getInstance(pc.getId(),pc.getServletContext());
    TypeMapping tm = server.getEngine().getTypeMappingRegistry().getDefaultTypeMapping();
   
    return AxisCaster.toAxisType(tm,c.call(pc,method.getName(),toRailoType(pc,args)),null);
  }
View Full Code Here

     * search in methods of a class for complex types
     * @param clazz
     * @return
     */
    private static Class registerTypeMapping(Class clazz) throws AxisFault {
      PageContext pc = ThreadLocalPageContext.get();
      RPCServer server=RPCServer.getInstance(pc.getId(),pc.getServletContext());
    return registerTypeMapping(server, clazz);
    }
View Full Code Here

    }
  }
  public static Object _invoke(String name, Object[] args) throws PageException {
    Key key = Caster.toKey(name);
    Component c=component.get();
    PageContext p=pagecontext.get();
    if(c==null) throw new ApplicationException("missing component");
    if(p==null) throw new ApplicationException("missing pagecontext");
   
    for(int i=0;i<args.length;i++) {
      args[i]=AxisCaster.toRailoType(p,args[i]);
    }
   
    Object udf = c.get(p,key,null);
    String rt="any";
    if(udf instanceof UDF) {
      rt=((UDF)udf).getReturnTypeAsString();
    }
    Object rv = c.call(p, key, args);
   
    try {
      RPCServer server = RPCServer.getInstance(p.getId(),p.getServletContext());
      TypeMapping tm = server.getEngine().getTypeMappingRegistry().getDefaultTypeMapping();
      rv=Caster.castTo(p, rt, rv, false);
      Class clazz = Caster.cfTypeToClass(rt);
      return AxisCaster.toAxisType(tm,rv,clazz.getComponentType()!=null?clazz:null);
    }
View Full Code Here

   
   
    DatasourceConnectionPool pool = ci.getDatasourceConnectionPool();
    Log log=((ConfigImpl)config).getScopeLogger();
    try {
      PageContext pc = ThreadLocalPageContext.get();// FUTURE change method interface
      DataSource ds;
      if(pc!=null) ds=((PageContextImpl)pc).getDataSource(datasourceName);
      else ds=config.getDataSource(datasourceName);
      dc=pool.getDatasourceConnection(null,ds,null,null);
      SQLExecutor executor=SQLExecutionFactory.getInstance(dc);
View Full Code Here

       new SQLItemImpl(cfid,Types.VARCHAR),
      new SQLItemImpl(applicationName,Types.VARCHAR),
      new SQLItemImpl(now(config),Types.VARCHAR)
    });
     
      PageContext pc = ThreadLocalPageContext.get();
   
    try {
      query = new QueryImpl(pc,dc,sqlSelect,-1,-1,-1,"query");
    }
      catch (DatabaseException de) {
View Full Code Here

    return execute(client, config, getMethodName(), getArguments());
  }
 
  public static final Object execute(RemoteClient client, Config config, String methodName, Struct args) throws PageException {
    //return rpc.callWithNamedValues(config, getMethodName(), getArguments());
    PageContext pc = ThreadLocalPageContext.get();
   
   
    // remove wsdl if necessary
    String url=client.getUrl();
    if(StringUtil.endsWithIgnoreCase(url,"?wsdl"))
View Full Code Here

       
      }
      catch(Throwable t){
        return;
      }
      PageContext orgPC = ThreadLocalPageContext.get();
      ThreadLocalPageContext.register(pc);
        try{
        TagLibTagAttr attrFileName,attrIsWeb;
          String filename;
        Boolean isWeb;
View Full Code Here

//    String type=elStruct.getAttribute("type");
    String name=elComp.getAttribute("name");
    String md5=elComp.getAttribute("md5");
   
    // TLPC
    PageContext pc = ThreadLocalPageContext.get();
   
    // Load comp
    ComponentAccess comp=null;
    try {
      comp = ComponentUtil.toComponentAccess(pc.loadComponent(name));
      if(!ComponentUtil.md5(comp).equals(md5)){
        throw new ConverterException("component ["+name+"] in this enviroment has not the same interface as the component to load, it is possible that one off the components has Functions added dynamicly.");
      }
    }
    catch (ConverterException e) {
View Full Code Here

TOP

Related Classes of railo.runtime.PageContext

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.