Flash Player (GMT +X) -> IExternizable methods (GMT + X - X = GMT + 0) - > AMF over HTTP (GMT + 0) -> Granite AMF0Deserializer (GMT + 0) -> Granite Converter (GMT + 0 + Y = GMT + Y) -> Java Services (GMT + Y)Java Services (GMT + Y) -> Granite Converter (GMT + Y - Y = GMT + 0) -> Granite AMF0Deserializer (GMT + 0) -> AMF over HTTP (GMT + 0) -> IExternizable methods (GMT + 0 + X = GMT + X) -> Flash Player (GMT + X)
We use
GMT + 0
for AMF for convention
define a
fixed timezone
for your AMF that is over HTTP
GMT + X
: timezone for your flex client
GMT + Y
: timezone for your server
don't want to modify the default templates
override the readExternal / writeExternal methods and do the conversion here.
The patch is to use a custom template for generating your as files with a conversion to GMT 0 in the implementations of IExternalizable methods.On the server-side you add a Converter to convert dates GMT 0 to dates GMT + Y.
Due to the limited capabilities of the ActionScript 3 reflection API than cannot access private fields, it is necessary to create
an externalizable AS3 class (implementing flash.utils.IExternalizable and its corresponding externalizable Java class
writeExternal
In both classes you have to implement two methods
the Gas3 generator can automatically generate the writeExternal and readExternal methods.
With GraniteDS automated externalization and without any modification made to our bean, we may serialize all properties of the Person class,
private or not
In order to externalize the Person.java entity bean, we must tell GraniteDS which classes we want to externalize
with a
externalize all classes named com.myapp.entity.Person by using the org.granite.hibernate.HibernateExternalizer
you could use this declaration, but note that type in the example above
is replaced by
allows me to switch between different endpoints - different test or production servers for instance - just by specifying the ip and port in an external properties file
don't have to specify any compiler arguments that point to the services-config.xml or messaging-config.xml files.