Examples of ASObject


Examples of flex.messaging.io.amf.ASObject

            if (context.isLegacy())
            {
                if (methodResult instanceof ErrorMessage)
                {
                    ErrorMessage error = (ErrorMessage)methodResult;
                    ASObject aso = new ASObject();
                    aso.put("message", error.faultString);
                    aso.put("code", error.faultCode);
                    aso.put("details", error.faultDetail);
                    aso.put("rootCause", error.rootCause);
                    methodResult = aso;
                }
                else if (methodResult instanceof Message)
                {
                    methodResult = ((Message)methodResult).getBody();
View Full Code Here

Examples of flex.messaging.io.amf.ASObject

            Map map = (Map)obj;

            //Check for an Object.registerClass Typed ASObject
            if (map instanceof ASObject)
            {
                ASObject aso = (ASObject)map;
                type = aso.getType();
            }

            SerializationContext sc = SerializationContext.getSerializationContext();
           
            if (type == null && sc.supportRemoteClass)
View Full Code Here

Examples of flex.messaging.io.amf.ASObject

            if (aliasedClass != null)
                type = aliasedClass;

            if (type == null || type.length() == 0)
            {
                object = new ASObject();
            }
            else if (type.startsWith(">")) // Handle [RemoteClass] (no server alias)
            {
                object = new ASObject();
                ((ASObject)object).setType(type);
            }
            else if (context.instantiateTypes || type.startsWith("flex."))
            {
                Class desiredClass = AbstractProxy.getClassFromClassName(type, context.createASObjectForMissingType);

                proxy = PropertyProxyRegistry.getRegistry().getProxyAndRegister(desiredClass);

                if (proxy == null)
                    object = ClassUtil.createDefaultInstance(desiredClass, null);
                else
                    object = proxy.createInstance(type);
            }
            else
            {
                // Just return type info with an ASObject...
                object = new ASObject();
                ((ASObject)object).setType(type);
            }
        }
        else
        {
            // TODO: QUESTION: Pete, Investigate why setValue for ASObject is delayed to endObject
            object = new ASObject(type);
        }

        if (proxy == null)
            proxy = PropertyProxyRegistry.getProxyAndRegister(object);
View Full Code Here

Examples of flex.messaging.io.amf.ASObject

            catch (IndexOutOfBoundsException ex)
            {
                throw new MessageException("Object has no trait info for value: " + value);
            }

            ASObject aso = (ASObject)obj;
            aso.put(prop, value);

            if (isDebug)
                trace.namedElement(prop);
        }
View Full Code Here

Examples of flex.messaging.io.amf.ASObject

  }
  protected Object toAMFObject(Query query) throws PageException {
    List<ASObject> result = new ArrayList<ASObject>();
    int len=query.getRecordcount();
        Collection.Key[] columns=CollectionUtil.keys(query);
      ASObject row;
        for(int r=1;r<=len;r++) {
          result.add(row = new ASObject());
            for(int c=0;c<columns.length;c++) {
                row.put(toString(columns[c],forceQueryLower), toAMFObject(query.getAt(columns[c],r)) );
            }
        }
    return result;
  }
View Full Code Here

Examples of flex.messaging.io.amf.ASObject

      return img.getImageBytes("png");
    }
  }

  protected ASObject toAMFObject(Component cfc) throws PageException {
    ASObject aso = new ASObject();
    aso.setType(cfc.getCallName());
   
   
    Component c=cfc;
    if(cfc instanceof ComponentAccess)c=ComponentWrap.toComponentWrap(methodAccessLevel,cfc);
   

    Property[] prop = cfc.getProperties(false);
    Object v; UDF udf;
      if(prop!=null)for(int i=0;i<prop.length;i++) {
        boolean remotingFetch = Caster.toBooleanValue(prop[i].getDynamicAttributes().get(REMOTING_FETCH,Boolean.TRUE),true);
        if(!remotingFetch) continue;
       
        v=cfc.get(prop[i].getName(),null);
        if(v==null){
          v=c.get("get"+prop[i].getName(),null);
          if(v instanceof UDF){
                udf=(UDF) v;
                if(udf.getReturnType()==CFTypes.TYPE_VOID) continue;
                if(udf.getFunctionArguments().length>0) continue;
               
                try {
            v=c.call(ThreadLocalPageContext.get(), udf.getFunctionName(), ArrayUtil.OBJECT_EMPTY);
          } catch (PageException e) {
            continue;
          }
              }
        }
       
        aso.put(toString(prop[i].getName(),forceCFCLower), toAMFObject(v));
      }
      return aso;
  }
View Full Code Here

Examples of flex.messaging.io.amf.ASObject

  }
 

  protected ASObject toAMFObject(Component cfc) throws PageException {
    // add properties
    ASObject aso = doProperties?super.toAMFObject(cfc):new ASObject();
    ComponentWrap cw=null;
    if(cfc instanceof ComponentAccess)cw=ComponentWrap.toComponentWrap(Component.ACCESS_REMOTE,cfc);
   
    Iterator it = cfc.entrySet().iterator();
        Map.Entry entry;
        Object v;
        Collection.Key k;
        UDF udf;
        String name;
        while(it.hasNext()) {
            entry=(Entry) it.next();
            k=KeyImpl.toKey(entry.getKey());
            v=entry.getValue();
           
            // add getters
            if(v instanceof UDF){
              if(!doGetters) continue;
              udf=(UDF) v;
              name=udf.getFunctionName();
              if(!StringUtil.startsWithIgnoreCase(name, "get"))continue;
              if(udf.getReturnType()==CFTypes.TYPE_VOID) continue;
              if(udf.getFunctionArguments().length>0) continue;
             
              try {
          v=cfc.call(ThreadLocalPageContext.get(), name, ArrayUtil.OBJECT_EMPTY);
        } catch (PageException e) {
          continue;
        }
              name=name.substring(3);
             
              aso.put(toString(name,forceCFCLower), toAMFObject(v));
            }
           
            // add remote data members
            if(cw!=null && doRemoteValues){
              v=cw.get(k,null);
              if(v!=null)aso.put(toString(k,forceCFCLower), toAMFObject(v));
            }
        }
        return aso;
  }
View Full Code Here

Examples of flex.messaging.io.amf.ASObject

          {
            handleArrayOfJsonRequests(info.inputStream,response);
          }
          else // AMF3
          {
            ASObject obj = (ASObject)deserializeAmf3(info.inputStream);
            methodName = (String) obj.get(METHOD);
            methodParams = obj.get(PARAMS);
            info.streamParameterIndex = (Number) obj.get(STREAM_PARAMETER_INDEX);
            invokeMethod(methodName, methodParams);
          }
        }
        catch (IOException e)
        {
View Full Code Here

Examples of flex.messaging.io.amf.ASObject

  }
 
  //  De-serialize a ByteArray/AMF3/Flex object to a Java object 
  protected ASObject deserializeAmf3(InputStream inputStream) throws ClassNotFoundException, IOException
  {
    ASObject deSerializedObj = null;
 
    Amf3Input amf3Input = new Amf3Input(serializationContext);
    amf3Input.setInputStream(inputStream); // uncompress
    deSerializedObj = (ASObject) amf3Input.readObject();
    //amf3Input.close();
View Full Code Here

Examples of flex.messaging.io.amf.ASObject

        {
            message.append("with value '").append(object.toString()).append("' ");
        }
        else if (object instanceof ASObject)
        {
            ASObject aso = (ASObject)object;
            message.append("with remote type specified as '").append(aso.getType()).append("' ");
        }

        message.append("to an instance of ").append(desiredClass.toString());

        TranslationException ex = new TranslationException(message.toString());
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.