-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Support For BlazeDS & Fixed ArrayCollection Deserialization #2
Conversation
You are quite right about the externalizable flag. I haven't dealt with it in readScriptObject. Do you intend to use externalizable objects? flex.messaging.io.amf.Amf3Types.java public interface Amf3Types
{
// AMF marker constants
int kUndefinedType = 0;
int kNullType = 1;
int kFalseType = 2;
int kTrueType = 3;
int kIntegerType = 4;
int kDoubleType = 5;
int kStringType = 6;
int kXMLType = 7;
int kDateType = 8;
int kArrayType = 9;
int kObjectType = 10;
int kAvmPlusXmlType = 11;
int kByteArrayType = 12;
int kTypedVectorInt = 13;
int kTypedVectorUint= 14;
int kTypedVectorDouble = 15;
int kTypedVectorObject = 16;
int kDictionaryType = 17; 0x11 = 17 the kDictionaryType flex.messaging.io.amf.Amf3Input.java public Object readObject() throws ClassNotFoundException, IOException
{
int type = in.readByte();
Object value = readObjectValue(type);
return value;
} type is read here and passed to readObjectValue protected Object readObjectValue(int type) throws ClassNotFoundException, IOException
{
Object value = null;
switch (type)
{
...
case kObjectType:
value = readScriptObject();
break;
...
case kDictionaryType:
value = readDictionary();
break;
...
}
return value;
} When the marker is kObjectType 10 then readScriptObject does the work. Based on the BlazeDS implementation of readTraits, I would stick with boolean dynamic = ((ref & 8) == 8); When the marker is kDictionaryType 17 then readDictionary does the work. Except I haven't implemented it. Also can you give me a small Java snippet of your ArrayCollection usage. I would like to test any changes to make sure PHP server is still happy. |
Any Java object which implements java.util.Collection (any List or Set) get automatically mapped to flex.messaging.io.ArrayCollection
Edit: in the current code we don't uses dictionaries but always strictly typed object. In a later commit we added the ability to register javascript class to be used (if found) when deserializing the objects |
I have committed some changes based on your messageId sending. Just making it conditional based on a amf.sendMessageId setting. Since you do not use Dictionary for now I will not worry about. Working on setting up a simple Java server to test working with collections. I noticed your class registry change. If it works for you, I would be happy to see a simple example that I can put in the documentation and pull it in. Would be interested to know what project you are working on. |
I've just merged your changes (I've to do some fixes to handle externalizable objects). |
No description provided.