<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Adding enum support to Flex AMF protocol</title>
	<atom:link href="http://flexblog.faratasystems.com/2007/09/16/adding-enum-support-to-flex-amf-protocol/feed" rel="self" type="application/rss+xml" />
	<link>http://flexblog.faratasystems.com/2007/09/16/adding-enum-support-to-flex-amf-protocol</link>
	<description>A blog about our experience with Adobe Flex</description>
	<lastBuildDate>Sun, 15 Jan 2012 16:29:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Chris</title>
		<link>http://flexblog.faratasystems.com/2007/09/16/adding-enum-support-to-flex-amf-protocol/comment-page-1#comment-76394</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Wed, 11 Aug 2010 12:02:02 +0000</pubDate>
		<guid isPermaLink="false">http://flexblog.faratasystems.com/?p=242#comment-76394</guid>
		<description>Hi, 
I&#039;m trying to get this to work with BlazeDS 4. I&#039;ve got it working from the server to the client, but when an Enum is sent from the client to the server I end up with the &#039;Types cannot be instantiated without a public, no arguments constructor.&#039; error message. 

Any help would be very appreciated.

Thanks, Chris</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I&#8217;m trying to get this to work with BlazeDS 4. I&#8217;ve got it working from the server to the client, but when an Enum is sent from the client to the server I end up with the &#8216;Types cannot be instantiated without a public, no arguments constructor.&#8217; error message. </p>
<p>Any help would be very appreciated.</p>
<p>Thanks, Chris</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hillolsarker</title>
		<link>http://flexblog.faratasystems.com/2007/09/16/adding-enum-support-to-flex-amf-protocol/comment-page-1#comment-37394</link>
		<dc:creator>hillolsarker</dc:creator>
		<pubDate>Tue, 25 Nov 2008 12:35:28 +0000</pubDate>
		<guid isPermaLink="false">http://flexblog.faratasystems.com/?p=242#comment-37394</guid>
		<description>I am using BlazeDS. I did same as etho said. I worked. But, having problem with StreamingAMFEndpoint. It registered both J5AmfMessageDeserializer and J5AmfMessageSerializer for StreamingAMFEndpoint. But enum isn&#039;t working here.</description>
		<content:encoded><![CDATA[<p>I am using BlazeDS. I did same as etho said. I worked. But, having problem with StreamingAMFEndpoint. It registered both J5AmfMessageDeserializer and J5AmfMessageSerializer for StreamingAMFEndpoint. But enum isn&#8217;t working here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: etho</title>
		<link>http://flexblog.faratasystems.com/2007/09/16/adding-enum-support-to-flex-amf-protocol/comment-page-1#comment-34955</link>
		<dc:creator>etho</dc:creator>
		<pubDate>Mon, 04 Feb 2008 16:49:40 +0000</pubDate>
		<guid isPermaLink="false">http://flexblog.faratasystems.com/?p=242#comment-34955</guid>
		<description>I was able to figure it out. The problem was setSerializationContext was never getting called. Then, even when I made changes to have it be called, the outputStream was not being set on amfOut. This was leading a null pointer exception when serialization was taking place.

Here is the quick fix I was able to come up with:

public class J5AmfMessageSerializer extends AmfMessageSerializer {

//...

@Override public void initialize(SerializationContext context, OutputStream out, AmfTrace trace) {

    	super.initialize(context, out, trace);
    	amfOut = new J5Amf0Output(context);
    	amfOut.setOutputStream(out);
}

//...
//Note that setSerializationContext is still not called, but the same operation is performed in initialize(). I did this to ensure I had access to the proper OutputStream.

}



I don&#039;t know enough about AMF to be sure this is the correct place to make the changes, but it has so far worked for me. Valery, you mention that Adobe makes the LCDS API &quot;developer-friendly&quot; but I was not able to find any information on the classes that you extend in your post. May I ask where you got this information?

So far, I have only tried enum serialization, and am not sure if the same problem exists in the deserialization process.

I hope this helps anyone having the same issues.</description>
		<content:encoded><![CDATA[<p>I was able to figure it out. The problem was setSerializationContext was never getting called. Then, even when I made changes to have it be called, the outputStream was not being set on amfOut. This was leading a null pointer exception when serialization was taking place.</p>
<p>Here is the quick fix I was able to come up with:</p>
<p>public class J5AmfMessageSerializer extends AmfMessageSerializer {</p>
<p>//&#8230;</p>
<p>@Override public void initialize(SerializationContext context, OutputStream out, AmfTrace trace) {</p>
<p>    	super.initialize(context, out, trace);<br />
    	amfOut = new J5Amf0Output(context);<br />
    	amfOut.setOutputStream(out);<br />
}</p>
<p>//&#8230;<br />
//Note that setSerializationContext is still not called, but the same operation is performed in initialize(). I did this to ensure I had access to the proper OutputStream.</p>
<p>}</p>
<p>I don&#8217;t know enough about AMF to be sure this is the correct place to make the changes, but it has so far worked for me. Valery, you mention that Adobe makes the LCDS API &#8220;developer-friendly&#8221; but I was not able to find any information on the classes that you extend in your post. May I ask where you got this information?</p>
<p>So far, I have only tried enum serialization, and am not sure if the same problem exists in the deserialization process.</p>
<p>I hope this helps anyone having the same issues.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vsilaev</title>
		<link>http://flexblog.faratasystems.com/2007/09/16/adding-enum-support-to-flex-amf-protocol/comment-page-1#comment-34954</link>
		<dc:creator>vsilaev</dc:creator>
		<pubDate>Mon, 04 Feb 2008 11:19:45 +0000</pubDate>
		<guid isPermaLink="false">http://flexblog.faratasystems.com/?p=242#comment-34954</guid>
		<description>etho,

Unfortunately, LCDS and BlazeDS use different server-side implementation. You can find more details in the following post: http://flexblog.faratasystems.com/?p=277. In short words, you can&#039;t just drop the enum extension jar from this post and use it with BlazeDS. Probably we will add the BlazeDS version later, but no promises for now.</description>
		<content:encoded><![CDATA[<p>etho,</p>
<p>Unfortunately, LCDS and BlazeDS use different server-side implementation. You can find more details in the following post: <a href="http://flexblog.faratasystems.com/?p=277" rel="nofollow">http://flexblog.faratasystems.com/?p=277</a>. In short words, you can&#8217;t just drop the enum extension jar from this post and use it with BlazeDS. Probably we will add the BlazeDS version later, but no promises for now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: etho</title>
		<link>http://flexblog.faratasystems.com/2007/09/16/adding-enum-support-to-flex-amf-protocol/comment-page-1#comment-34949</link>
		<dc:creator>etho</dc:creator>
		<pubDate>Fri, 01 Feb 2008 22:20:49 +0000</pubDate>
		<guid isPermaLink="false">http://flexblog.faratasystems.com/?p=242#comment-34949</guid>
		<description>Thank you for this very nice solution. However, do you know if the serialization process has changed in BlazeDS? I tried to use your code in an application using BlazeDS and it does not work.

Specifically, the J5AmfMessageSerializer attempts to override the setSerializationContext method in AmfMessageSerializer, but the method does not exist. I guess the serialization process has changed.

Any ideas on how to change this code to work with BlazeDS?</description>
		<content:encoded><![CDATA[<p>Thank you for this very nice solution. However, do you know if the serialization process has changed in BlazeDS? I tried to use your code in an application using BlazeDS and it does not work.</p>
<p>Specifically, the J5AmfMessageSerializer attempts to override the setSerializationContext method in AmfMessageSerializer, but the method does not exist. I guess the serialization process has changed.</p>
<p>Any ideas on how to change this code to work with BlazeDS?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yakov Fain</title>
		<link>http://flexblog.faratasystems.com/2007/09/16/adding-enum-support-to-flex-amf-protocol/comment-page-1#comment-32689</link>
		<dc:creator>Yakov Fain</dc:creator>
		<pubDate>Sat, 01 Dec 2007 11:13:33 +0000</pubDate>
		<guid isPermaLink="false">http://flexblog.faratasystems.com/?p=242#comment-32689</guid>
		<description>The URL with the source code is listed in the blog: http://www.myflex.org/articles/downloads/farata-j5-messaging.src.zip</description>
		<content:encoded><![CDATA[<p>The URL with the source code is listed in the blog: <a href="http://www.myflex.org/articles/downloads/farata-j5-messaging.src.zip" rel="nofollow">http://www.myflex.org/articles/downloads/farata-j5-messaging.src.zip</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jon@vailms.com</title>
		<link>http://flexblog.faratasystems.com/2007/09/16/adding-enum-support-to-flex-amf-protocol/comment-page-1#comment-32618</link>
		<dc:creator>jon@vailms.com</dc:creator>
		<pubDate>Thu, 29 Nov 2007 19:41:55 +0000</pubDate>
		<guid isPermaLink="false">http://flexblog.faratasystems.com/?p=242#comment-32618</guid>
		<description>Great post.  Exactly what we needed.  Is the source code for farata-j5-messaging-fds.jar available anywhere?</description>
		<content:encoded><![CDATA[<p>Great post.  Exactly what we needed.  Is the source code for farata-j5-messaging-fds.jar available anywhere?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jon@vailms.com</title>
		<link>http://flexblog.faratasystems.com/2007/09/16/adding-enum-support-to-flex-amf-protocol/comment-page-1#comment-32617</link>
		<dc:creator>jon@vailms.com</dc:creator>
		<pubDate>Thu, 29 Nov 2007 19:11:57 +0000</pubDate>
		<guid isPermaLink="false">http://flexblog.faratasystems.com/?p=242#comment-32617</guid>
		<description>Your blog has been very helpful.  We are using FDS not LCDS.  I was hoping to look at the souce code for farata-j5-messaging-fds.jar, but I can&#039;t seem to find it.  Is it available?</description>
		<content:encoded><![CDATA[<p>Your blog has been very helpful.  We are using FDS not LCDS.  I was hoping to look at the souce code for farata-j5-messaging-fds.jar, but I can&#8217;t seem to find it.  Is it available?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: busitech</title>
		<link>http://flexblog.faratasystems.com/2007/09/16/adding-enum-support-to-flex-amf-protocol/comment-page-1#comment-30019</link>
		<dc:creator>busitech</dc:creator>
		<pubDate>Fri, 28 Sep 2007 21:19:42 +0000</pubDate>
		<guid isPermaLink="false">http://flexblog.faratasystems.com/?p=242#comment-30019</guid>
		<description>Thank you for publishing this approach to Enum serialization.  We approached this problem a little bit differently.  We created an abstract base class to be a wrapper for our Enums.  A class extending flex.messaging.io.BeanProxy becomes responsible for serialization.

Useful functions were added to the base Enum wrapper class which can respond to the Flex application upon initialization with all of the possible values for the corresponding enum, incliding a nicely formatted human-readable form of the name.  This array is only maintained on the Java server side, and once received by the client, the values automatically populate our enum-aware UI controls with values.  This is very useful for the enhanced ComboBox.  

Our AS class for each customized Enum is no more than an object which extends our Enum base class in Flex, with no additional fields or functions beyond a [Managed] and [Remote Class] definition.</description>
		<content:encoded><![CDATA[<p>Thank you for publishing this approach to Enum serialization.  We approached this problem a little bit differently.  We created an abstract base class to be a wrapper for our Enums.  A class extending flex.messaging.io.BeanProxy becomes responsible for serialization.</p>
<p>Useful functions were added to the base Enum wrapper class which can respond to the Flex application upon initialization with all of the possible values for the corresponding enum, incliding a nicely formatted human-readable form of the name.  This array is only maintained on the Java server side, and once received by the client, the values automatically populate our enum-aware UI controls with values.  This is very useful for the enhanced ComboBox.  </p>
<p>Our AS class for each customized Enum is no more than an object which extends our Enum base class in Flex, with no additional fields or functions beyond a [Managed] and [Remote Class] definition.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

