- JBoss 4.2.3 GA installed as a Server in Eclipse (using the Web Tool Platform JEE stuff)
- Spring framework 2.5.5
- A Spring-based Flex factory that allows Flex Remoting to talk to objects via Spring (author Jeff Vroom)
- Groovy - set up per Joe's recent instructions
- BlazeDS providing the Flex Remoting service
<factories>
<factory id="spring" class="flex.samples.factories.SpringFactory"/>
</factories>
and the context loader:
<factory id="spring" class="flex.samples.factories.SpringFactory"/>
</factories>
<!-- Spring -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<!-- load Spring's WebApplicationContext -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
and the destination for the RemoteObject:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<!-- load Spring's WebApplicationContext -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<destination id="place">
<properties>
<factory>spring</factory>
<source>placeholder</source>
</properties>
</destination>
Create a Flex AIR project and define a RemoteObject that refers to the destination you just defined:
<properties>
<factory>spring</factory>
<source>placeholder</source>
</properties>
</destination>
<mx:RemoteObject id="bcp"
destination="place"
endpoint="http://127.0.0.1:8080/bcpbackend/messagebroker/amf"
>
<mx:method name="test" result="testResult(event)" fault="testFault(event)"/>
</mx:RemoteObject>
Add the placeholder bean definition to your applicationContext.xml file:
destination="place"
endpoint="http://127.0.0.1:8080/bcpbackend/messagebroker/amf"
>
<mx:method name="test" result="testResult(event)" fault="testFault(event)"/>
</mx:RemoteObject>
<bean id="placeholder" class="com.broadchoice.bcp.Placeholder"/>
com.broadchoice.bcp.Placeholder is a Groovy class that contains a test method (for testing it just takes a string and returns that string plus some additional text).

0 responses so far ↓
There are no comments yet...Kick things off by filling out the form below.
Leave a Comment