Hey,
> I'll dig into how the ColdFusion CFCProxy does it, and implement something
> similar for the DynamicCFCProxy if the current FusionContext is null. (I
> guess I will have to load it in a JSP for it to be tested.. this will be
> interesting).
cool - currently I use AOP to startup the FusionContext just in
time :)
> So are you loading up Spring inside JavaLoader? or are the JavaLoader tools
> loaded with CF in the classpath (i.e. placed in the /lib folder)?
it works like this:
1) in Application.cfc onApplicationStart() Javaloader is used to load
spring,jar, your spring support jars, some hibernate jars, jpa stuff
and some more libraries plus a classes folder with compiled classes
for the app (mainly JPA annotated entity classes mapped with
Hibernate)
2) Javaloader creates a new Spring context similar to your example
from the docs and loads the applicationContext.xml file
3) Spring initializes the beans (Java beans and CFC proxies)
4) using a custom FlexFactory (implemented as a Spring bean) I create
a new RemotingDestination on the MessageBroker living in CF and inject
a ServiceFacade bean
5) ServiceFacade bean acts as the remote Service that gets invoked
from Flex/AIR
6) when a remoting request comes in, the ServiceFacade invokes
business logic on injected Spring beans (either Java beans or CFC
proxy beans)
I first thought I'd just use a CFC for remoting as usual, but this has
some issues when it comes to serializing Java objects to AMF and vice
versa. Therefore I switched to a pure Java remoting endpoint which
calls CFCs instead of having a CFC that calls Java :)
I also thought about using the Spring BlazeDS Integration stuff (which
I used in BlazeDS before) but my custom solution works just fine here.
Dirk.