This link 可能会帮助一些人。
MessageBroker 透明地处理 Flex AMF 数据格式和 Java 之间的序列化和反序列化过程。
This link explains everything with help of example which was exactly what I was looking for
一些重要的设置信息如下
服务器端有以下文件
* testdrive/src/main/webapp/WEB-INF/spring/app-config.xml
* testdrive/src/main/webapp/WEB-INF/flex-servlet.xml
* testdrive/src/main/java/flex/spring/samples/product/ProductDAO.java
客户端有一个文件,看起来像这样
Step1) 在 flex-servlet.xml 中初始化一个 messagebroker
<flex:message-broker>
<flex:message-service
default-channels="my-streaming-amf,my-longpolling-amf,my-polling-amf" />
<flex:secured />
</flex:message-broker>
Step2) 在同一个flex-servlet.xml中指定一个标签
<flex:remoting-destination ref="productService" />
步骤 3) 在 app-config.xml 中
<bean id="contactService" class="org.springframework.flex.samples.product.ProductDAO">
<constructor-arg ref="dataSource" />
</bean>
步骤 4) ProductDAO.java 是为远程处理公开的类
客户端可以如下调用远程对象
第五步)
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<!-- "productService" is defined in Spring's configuration file WEB-INF/config/web-application-config.xml
and provides remote access to the org.springframework.flex.samples.product.ProductDAO class -->
<mx:RemoteObject id="ro" destination="productService"/>
<mx:DataGrid dataProvider="{ro.findAll.lastResult}" width="100%" height="100%"/>
<!-- the findAll() method is defined in org.springframework.flex.samples.product.ProductDAO -->
<mx:Button label="Get Data" click="ro.findAll()"/>
</mx:Application>