Package railo.runtime.type

Examples of railo.runtime.type.Struct


  public String subject() {
    return action+" ("+super.subject()+")";
  }
  @Override
  public Struct detail() {
    Struct sct=super.detail();
    sct.setEL("action", action);
    return sct;
  }
View Full Code Here


  }
 
  private Array translateTime(Array exp) {
    exp=(Array) Duplicator.duplicate(exp,true);
    Iterator<Object> it = exp.valueIterator();
    Struct sct;
    while(it.hasNext()) {
      sct=(Struct) it.next();
      sct.setEL(KeyConstants._time,new DateTimeImpl(Caster.toLongValue(sct.get(KeyConstants._time,null),0),true));
    }
    return exp;
  }
View Full Code Here

   
    synchronized (runningPcs) {
            //int len=runningPcs.size();
      Iterator<Key> it = runningPcs.keyIterator();
            PageContextImpl pc;
            Struct data,sctThread,scopes;
        Collection.Key key;
            Thread thread;
        while(it.hasNext()) {
              data=new StructImpl();
              sctThread=new StructImpl();
              scopes=new StructImpl();
              data.setEL("thread", sctThread);
                data.setEL("scopes", scopes);
               
             
              key=KeyImpl.toKey(it.next(),null);
                //print.out("key:"+key);
                pc=(PageContextImpl) runningPcs.get(key,null);
                if(pc==null || pc.isGatewayContext()) continue;
                thread=pc.getThread();
                if(thread==Thread.currentThread()) continue;

               
                thread=pc.getThread();
                if(thread==Thread.currentThread()) continue;
               
              
               
                data.setEL("startTime", new DateTimeImpl(pc.getStartTime(),false));
                data.setEL("endTime", new DateTimeImpl(pc.getStartTime()+pc.getRequestTimeout(),false));
                data.setEL(KeyConstants._timeout,new Double(pc.getRequestTimeout()));

               
                // thread
                sctThread.setEL(KeyConstants._name,thread.getName());
                sctThread.setEL("priority",Caster.toDouble(thread.getPriority()));
                data.setEL("TagContext",PageExceptionImpl.getTagContext(pc.getConfig(),thread.getStackTrace() ));

                data.setEL("urlToken", pc.getURLToken());
                try {
          if(pc.getConfig().debug())data.setEL("debugger", pc.getDebugger().getDebuggingData(pc));
        } catch (PageException e2) {}

                try {
          data.setEL("id", Hash.call(pc, pc.getId()+":"+pc.getStartTime()));
        } catch (PageException e1) {}
                data.setEL("requestid", pc.getId());

                // Scopes
                scopes.setEL(KeyConstants._name, pc.getApplicationContext().getName());
                try {
          scopes.setEL(KeyConstants._application, pc.applicationScope());
View Full Code Here

    catch(Throwable t) {
      PageException pe = Caster.toPageException(t);
      String st = ExceptionUtil.getStacktrace(t,true);
      //config.getErrWriter().write(st+"\n");
     
      Struct sct=new StructImpl();
      sct.setEL("message", pe.getMessage());
      sct.setEL("detail", pe.getDetail());
      sct.setEL("stacktrace", st);
      sct.setEL("time", Caster.toLong(System.currentTimeMillis()));
      exceptions.appendEL(sct);
     
      throw pe;
    }
    finally {
View Full Code Here

    return client.getLabel();
  }

  @Override
  public Struct detail() {
    Struct sct=new StructImpl();
    sct.setEL("label", client.getLabel());
    sct.setEL("url", client.getUrl());
   
    return sct;
  }
View Full Code Here

          config.getServerTagMapping().getPageSource(filename);
     
      Page p = ps.loadPage(pc);
      ComponentImpl c = ComponentLoader.loadComponent(pc, p, ps, filename, true,true);
      ComponentWrap cw = ComponentWrap.toComponentWrap(Component.ACCESS_PRIVATE,c);
      Struct meta = Caster.toStruct( cw.get(KeyConstants._metadata,null),null);

      // TODO handle all metadata here and make checking at runtime useless
      if(meta!=null) {
       
        // parse body
        boolean rtexprvalue=Caster.toBooleanValue(meta.get(KeyConstants._parsebody,Boolean.FALSE),false);
          tlt.setParseBody(rtexprvalue);
         
          // hint
          String hint=Caster.toString(meta.get(KeyConstants._hint,null),null);
          if(!StringUtil.isEmpty(hint))tlt.setDescription(hint);
         
      }
     
    }
View Full Code Here

      DatasourceConnection dc=ds instanceof DataSource?
          manager.getConnection(pageContext,(DataSource)ds,username,password):
          manager.getConnection(pageContext,Caster.toString(ds),username,password);
      try {
       
        Struct meta =null;
        try {
          meta=getMeta(dc,tablequalifier,tableowner,tablename);
        }
        catch(SQLException se){
          meta=new StructImpl();
View Full Code Here

    return datasource;
  }

  public static Struct getMeta(DatasourceConnection dc,String tableQualifier, String tableOwner, String tableName) throws SQLException {
      DatabaseMetaData md = dc.getConnection().getMetaData();
      Struct  sct=new StructImpl();
    ResultSet columns = md.getColumns(tableQualifier, tableOwner, tableName, null);
   
    try{
      String name;
      while(columns.next()) {
        name=columns.getString("COLUMN_NAME");
        sct.setEL(name, new ColumnInfo(name,columns.getInt("DATA_TYPE"),columns.getBoolean("IS_NULLABLE")));
       
      }
    }
    finally {
      DBUtil.closeEL(columns);
View Full Code Here


  public int doStartTag() throws PageException {
    if(true)throw new TagNotSupported("ntauthenticate");
        String os = System.getProperty("os.name");
        Struct resultSt = new StructImpl();
        pageContext.setVariable(result, resultSt);
       
       
        if(SystemUtil.isWindows())  {
          /*
 
View Full Code Here

    private void doGetScope() throws PageException {
        String sessionType=config.getSessionType()==Config.SESSION_TYPE_J2EE?"j2ee":"cfml";
        String localMode=AppListenerUtil.toLocalMode(config.getLocalMode(),"classic");
       
       
        Struct sct=new StructImpl();
        pageContext.setVariable(getString("admin",action,"returnVariable"),sct);
        sct.set("allowImplicidQueryCall",Caster.toBoolean(config.allowImplicidQueryCall()));
        sct.set("mergeFormAndUrl",Caster.toBoolean(config.mergeFormAndURL()));
       
        sct.set("sessiontype",sessionType);
        sct.set("localmode",localMode);
        sct.set("sessionManagement",Caster.toBoolean(config.isSessionManagement()));
        sct.set("clientManagement",Caster.toBoolean(config.isClientManagement()));
        sct.set("domainCookies",Caster.toBoolean(config.isDomainCookies()));
        sct.set("clientCookies",Caster.toBoolean(config.isClientCookies()));
        sct.set("clientStorage",config.getClientStorage());
        sct.set("sessionStorage",config.getSessionStorage());

       
        TimeSpan ts=config.getSessionTimeout();
        sct.set("sessionTimeout",ts);
        sct.set("sessionTimeout_day",Caster.toInteger(ts.getDay()));
        sct.set("sessionTimeout_hour",Caster.toInteger(ts.getHour()));
        sct.set("sessionTimeout_minute",Caster.toInteger(ts.getMinute()));
        sct.set("sessionTimeout_second",Caster.toInteger(ts.getSecond()));

        ts=config.getApplicationTimeout();
        sct.set("applicationTimeout",ts);
        sct.set("applicationTimeout_day",Caster.toInteger(ts.getDay()));
        sct.set("applicationTimeout_hour",Caster.toInteger(ts.getHour()));
        sct.set("applicationTimeout_minute",Caster.toInteger(ts.getMinute()));
        sct.set("applicationTimeout_second",Caster.toInteger(ts.getSecond()));

        ts=config.getClientTimeout();
        sct.set("clientTimeout",ts);
        sct.set("clientTimeout_day",Caster.toInteger(ts.getDay()));
        sct.set("clientTimeout_hour",Caster.toInteger(ts.getHour()));
        sct.set("clientTimeout_minute",Caster.toInteger(ts.getMinute()));
        sct.set("clientTimeout_second",Caster.toInteger(ts.getSecond()));
       
       
        // scope cascading type
        if(config.getScopeCascadingType()==Config.SCOPE_STRICT) sct.set("scopeCascadingType","strict");
        else if(config.getScopeCascadingType()==Config.SCOPE_SMALL) sct.set("scopeCascadingType","small");
        else if(config.getScopeCascadingType()==Config.SCOPE_STANDARD) sct.set("scopeCascadingType","standard");
    }
View Full Code Here

TOP

Related Classes of railo.runtime.type.Struct

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.