In Chapters 7 and 9, you will learn about custom adapters. In this brief section, I will illustrate an example that shows how you can configure a custom adapter.
Gilead, a custom Hibernate adapter that you will learn about in Chapter 7, can be configured in remoting-config.xml like so:
<adapters> <adapter-definition id="persistent-adapter" class="net.sf.gilead.blazeds.adapter.PersistentAdapter"> <properties> <persistence-factory> <class>net.sf.gilead.sample.server.ApplicationContext</class> <singleton>true</singleton> <method>getSessionFactory</method> </persistence-factory> </properties> </adapter-definition> </adapters>
Using the Spring BlazeDS adapter JSON format is used to configure parameters on a custom adapter. The preceding configuration under Spring BlazeDS would be:
<bean id="persistent-adapter" class="org.springframework.flex.core.ManageableComponentFactoryBean"> <constructor-arg value="net.sf.gilead.blazeds.adapter.PersistentAdapter"/> <property name="properties"> <value> {"persistenceFactory" : { "class" : "net.sf.gilead.sample.server.ApplicationContext", "singleton" : "true", "method": "getSessionFactory" } } </value> </property> </bean>
The Spring BlazeDS configuration for custom adapters configures these adapters using the org.springframework.flex.core.ManageableComponentFactoryBean.
18.118.2.225