Package railo.runtime.type.cfc

Examples of railo.runtime.type.cfc.ComponentAccess


    return null;
  }

  @Override
  public boolean onApplicationStart(PageContext pc) throws PageException {
    ComponentAccess app = apps.get(pc.getApplicationContext().getName());
    if(app!=null && app.contains(pc,ON_APPLICATION_START)) {
      Object rtn = call(app,pc, ON_APPLICATION_START, ArrayUtil.OBJECT_EMPTY,true);
      return Caster.toBooleanValue(rtn,true);
    }
    return true;
  }
View Full Code Here


    return true;
  }

  @Override
  public void onApplicationEnd(CFMLFactory factory, String applicationName) throws PageException {
    ComponentAccess app = apps.get(applicationName);
    if(app==null || !app.containsKey(ON_APPLICATION_END)) return;
   
    PageContextImpl pc=(PageContextImpl) ThreadLocalPageContext.get();
    boolean createPc=pc==null;
    try {
      if(createPc)pc =  createPageContext(factory,app,applicationName,null,ON_APPLICATION_END);
View Full Code Here

    }
  }
 
  @Override
  public void onSessionStart(PageContext pc) throws PageException {
    ComponentAccess app = apps.get(pc.getApplicationContext().getName());
    if(hasOnSessionStart(pc,app)) {
      call(app,pc, ON_SESSION_START, ArrayUtil.OBJECT_EMPTY,true);
    }
  }
View Full Code Here

    }
  }

  @Override
  public void onSessionEnd(CFMLFactory factory, String applicationName, String cfid) throws PageException {
    ComponentAccess app = apps.get(applicationName);
    if(app==null || !app.containsKey(ON_SESSION_END)) return;
   
    PageContextImpl pc=null;
    try {
      pc = createPageContext(factory,app,applicationName,cfid,ON_SESSION_END);
      call(app,pc, ON_SESSION_END, new Object[]{pc.sessionScope(false),pc.applicationScope()},true);
View Full Code Here

  }

  @Override
  public void onDebug(PageContext pc) throws PageException {
    if(((PageContextImpl)pc).isGatewayContext() || !pc.getConfig().debug()) return;
    ComponentAccess app = apps.get(pc.getApplicationContext().getName());
    if(app!=null && app.contains(pc,ON_DEBUG)) {
      call(app,pc, ON_DEBUG, new Object[]{pc.getDebugger().getDebuggingData(pc)},true);
      return;
    }
    try {
      pc.getDebugger().writeOut(pc);
View Full Code Here

    }
  }

  @Override
  public void onError(PageContext pc, PageException pe) {
    ComponentAccess app =  apps.get(pc.getApplicationContext().getName());
    if(app!=null && app.containsKey(ON_ERROR) && !Abort.isSilentAbort(pe)) {
      try {
        String eventName="";
        if(pe instanceof ModernAppListenerException) eventName= ((ModernAppListenerException)pe).getEventName();
        if(eventName==null)eventName="";
       
View Full Code Here

      //pc.removeLastPageSource(true);
    }*/
    }
   
    private static Object _toPojo(PageContext pc, TypeMapping tm,Component comp, Class targetClass, Set<Object> done) throws PageException {//print.ds();System.exit(0);
      ComponentAccess ca = ComponentUtil.toComponentAccess(comp);
      comp=ComponentWrap.toComponentWrap(Component.ACCESS_PRIVATE,ca);
    ComponentScope scope = ca.getComponentScope();
     
      Property[] props=comp.getProperties(false);
      //Map rtn=new HashTable();
      Object obj=null;
    try {
View Full Code Here

    public static Object toRailoType(PageContext pc, Object value) throws PageException {
      pc=ThreadLocalPageContext.get(pc);
      if(pc!=null && value instanceof Pojo) {
        try{
          ComponentAccess c = ComponentUtil.toComponentAccess(pc.loadComponent(value.getClass().getName()));
          ComponentWrap cw=ComponentWrap.toComponentWrap(Component.ACCESS_PRIVATE,c);
       
          // delete this scope data members
            Collection.Key[] keys = cw.keys();
            Object member;
            for(int i=0;i<keys.length;i++) {
              member = cw.get(keys[i]);
              if(member instanceof UDF) continue;
                    cw.removeEL(keys[i]);
            }
           
           
            Property[] props = c.getProperties(false);
            Property prop;
            for(int i=0;i<props.length;i++){
              prop=props[i];
              try{
                cw.set(pc, KeyImpl.init(prop.getName()), toRailoType(pc,Reflector.callGetter(value, prop.getName())));
View Full Code Here

   
    RestSettings settings = pc.getApplicationContext().getRestSettings();
    ArrayList<Source> sources = new ArrayList<Source>();
 
    PageSource ps;
    ComponentAccess cfc;
    Struct meta;
    String path;
    for(int i=0;i<children.length;i++){
      try{
        ps = pc.toPageSource(children[i],null);
        cfc = ComponentLoader.loadComponent(pc, null, ps, children[i].getName(), true,true);
        meta = cfc.getMetaData(pc);
        if(Caster.toBooleanValue(meta.get(KeyConstants._rest,null),false)){
          path = Caster.toString(meta.get(KeyConstants._restPath,null),null);
          sources.add(new Source(mapping, cfc.getPageSource(), path));
        }
      }
      catch(Throwable t){
        if(!settings.getSkipCFCWithError()) throw Caster.toPageException(t);
      }
View Full Code Here

TOP

Related Classes of railo.runtime.type.cfc.ComponentAccess

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.