<beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:jaxws="http://cxf.apache.org/jaxws"
      xmlns:jaxrs="http://cxf.apache.org/jaxrs"
      xsi:schemaLocation="
         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
         http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
         http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd">

	<import resource="classpath:META-INF/cxf/cxf.xml" />
	<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />

	<jaxws:endpoint id="mediatorService"
		implementorClass="gov.va.med.cds.ejb.SynchronousMessageBean"
		implementor="#mediatorStatelessSession"
		address="/mediator-service" 
		/>
		
	<jaxrs:server id="isAliveServiceProxy" address="/mediator-service/isAlive">
		<jaxrs:serviceBeans>
			<bean class="gov.va.med.mediator.webservice.RestMediatorServiceIsAliveProxy">
				<property name="mediatorService" ref="mediatorStatelessSession"/>
			</bean>
		</jaxrs:serviceBeans>
	</jaxrs:server>
	
	<jaxrs:server id="processMessageServiceProxy" address="/mediator-service/processMessage">
		<jaxrs:serviceBeans>
			<bean class="gov.va.med.mediator.webservice.RestMediatorServiceProcessMessageProxy">
				<property name="mediatorService" ref="mediatorStatelessSession"/>
			</bean>
		</jaxrs:serviceBeans>
	</jaxrs:server>
	
	<jaxrs:server id="processMessage1ServiceProxy" address="/mediator-service/processMessage1">
		<jaxrs:serviceBeans>
			<bean class="gov.va.med.mediator.webservice.RestMediatorServiceProcessMessageProxy">
				<property name="mediatorService" ref="mediatorStatelessSession"/>
			</bean>
		</jaxrs:serviceBeans>
	</jaxrs:server>

	<bean id="mediatorStatelessSession" class="org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean"
		lazy-init="true">
		<!--
			For some reason the web module wants to load before the EJB module in weblogic. This property keeps the EJB local
			home look up from happening during the web module deployment phase. It will get looked up on the first method call.
		-->
		<property name="lookupHomeOnStartup" value="false"/>
		<property name="jndiName">
			<value>comp/env/ejb/local/gov/va/med/cds/messagemediator/SynchronousMessageBean</value>
		</property>
		<property name="jndiEnvironment">
			<props>
				<prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>
			</props>
		</property>
		<property name="businessInterface">
			<value>gov.va.med.mediator.client.messagemediator.MessageMediatorInterface</value>
		</property>
	</bean>

	<!-- <bean id="xsltHelper" class="gov.va.med.cds.xml.transform.XsltHelper">
		<property name="xsltLocations">
			<list>
				<value>classpath:gov/va/med/cds/xslt/*.xsl</value>
				<value>classpath:gov/va/med/cds/xslt/filter/*.xsl</value>
			</list>
		</property>
	</bean> -->

</beans>
