Hi, 

i have a shared object in red5 that contains attributes of the class
Student:

class Student {
 String name;
 String surname;
}

Red5 then fills the shared object "students" with attributes, for example:

ISharedObject s1 = getSharedObject(scope, "students",false);
s1.beginUpdate();
Student student1 = new Student();
student1.name = "Name1";
student1.label = "Surname1";
s1.setAttribute("1", student1);
s1.endUpdate();

Then, in Flex i can access the shared object properties simply with:

sharedobject.data["1"].name
sharedobject.data["1"].surname

that works fine.


Back to red5, if i want to access the sharedobject from some other method
and iterate through all the attributes i use:

ISharedObject s1 = getSharedObject(scope, "students",false);
Map it = s1.getAttributes();
int mapsize = it.size();
for (int i = 0; i < mapsize; i++)
{
        Map.Entry entry = (Map.Entry) kp.next();
        Object key = entry.getKey();
        Student value = (Student)entry.getValue(); // here i cast it back to
the Student class
        value.name = ... 
        value.surname = ...
}

This all works fine. Now the problem is that in red5 the casting back to
Student class of some attribute from the sharedobject data doesn't work IF i
change the sharedobject from Flex, by example:

sharedobject.data["1"].name = "some other name";
sharedobject.data.setDirty("1");

When the red5 server accesses the sharedobject attribute and tries to cast
it back to Student class it reports:

[java] java.lang.ClassCastException: org.red5.io.utils.ObjectMap cannot be
cast to org.red5.myApp.Application$Student

Anybody with similar problems, ideas how to solve this?

tnx,
Gregor


_______________________________________________
Red5 mailing list
[EMAIL PROTECTED]
http://osflash.org/mailman/listinfo/red5_osflash.org

Reply via email to