<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:flex="http://www.springframework.org/schema/flex"
       xsi:schemaLocation="
		http://www.springframework.org/schema/beans 
		http://www.springframework.org/schema/beans/spring-beans-2.5.xsd 
		http://www.springframework.org/schema/flex 
		http://www.springframework.org/schema/flex/spring-flex-1.0.xsd 
		http://www.springframework.org/schema/security 
		http://www.springframework.org/schema/security/spring-security-2.0.4.xsd">

    <bean id="hibernate-lazy-adapter" class="org.springframework.flex.core.ManageableComponentFactoryBean">
        <constructor-arg value="net.digitalprimates.persistence.hibernate.HibernateAdapter"/>
            <property name="properties">
                <value>
			        {
			            "hibernate":
			            {
			                "sessionFactory":
			                { 
			                    "class":"net.digitalprimates.persistence.hibernate.utils.SpringSessionUtil",
			                    "getCurrentSessionMethod":"getCurrentSession"
			                }
			            }
			        } 
                </value>
        </property>
    </bean>

    <flex:message-broker>
        <flex:remoting-service default-adapter-id="hibernate-lazy-adapter"/>
    </flex:message-broker> 

    <bean id="TestService" class="com.rmg.synergy.services.TestService" >
		<property name="sessionFactory" ref="sessionFactory" />
    </bean>
    
	<flex:remoting-destination ref="TestService" />

	<bean id="errorMessages"
		class="org.springframework.beans.factory.config.PropertiesFactoryBean">
		<property name="location">
			<value>classpath:messages.properties</value>
		</property>
	</bean>
	
</beans>
