<?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:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">

	<bean id="hdrDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
		<property name="jndiName" value="${cds.jdbc.dataSource.hdr2.jndiName}" />
	</bean>

	<bean id="vistaDataSourceBindingsLocator" class="gov.va.med.cds.persistence.JNDIDataSourceBindingsLocator">
		<property name="initialContext">
			<bean class="javax.naming.InitialContext">
				<constructor-arg>
					<props>
						<prop key="#{initialContextFactory}">weblogic.jndi.WLInitialContextFactory</prop>
					</props>
				</constructor-arg>
			</bean>
		</property>
		<property name="namedContext" value="${cds.jdbc.dataSource.vista.context.jndiName}" />
	</bean>

	<util:constant id="initialContextFactory" static-field="javax.naming.Context.INITIAL_CONTEXT_FACTORY" />
	<util:constant id="providerUrl" static-field="javax.naming.Context.PROVIDER_URL" />

	<bean id="workManager" class="gov.va.med.cds.transaction.SpringWorkManagerScheduler">
		<property name="workManager" ref="workManagerTaskExecutor" />
	</bean>

	<bean id="workManagerTaskExecutor" class="org.springframework.scheduling.commonj.WorkManagerTaskExecutor">
		<property name="workManagerName" value="java:comp/env/workManagers/ConcurrentRead" />
	</bean>

	<bean id="queryThreadWorkManager" class="gov.va.med.cds.transaction.SpringWorkManagerScheduler">
		<property name="workManager" ref="queryThreadWorkManagerTaskExecutor" />
	</bean>

	<bean id="queryThreadWorkManagerTaskExecutor" class="org.springframework.scheduling.commonj.WorkManagerTaskExecutor">
		<property name="workManagerName" value="java:comp/env/workManagers/QueryConcurrentRead" />
	</bean>


	<bean id="templateSearchPathGenerator" class="gov.va.med.cds.util.ConstructedSearchPathGenerator">
		<property name="firstSystemPropertyName" value="user.dir" />
		<property name="firstFilePathPiece" value="servers" />
		<property name="secondSystemPropertyName" value="weblogic.Name" />
		<property name="secondFilePathPiece" value="tmp/_WL_user/cds-ear*/**/templatecache" />
	</bean>

	<bean id="mbeanServer" class="org.springframework.jndi.JndiObjectFactoryBean">
		<property name="jndiName" value="java:comp/env/jmx/runtime" />
	</bean>

	<bean id="hdr2TransactionManager" class="org.springframework.transaction.jta.WebLogicJtaTransactionManager" />

	<!-- Spring JMS Configuration start -->
	<bean id="cachedCdsConnectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
		<property name="targetConnectionFactory">
			<bean class="org.springframework.jndi.JndiObjectFactoryBean">
				<property name="jndiName" value="jms/cds/CdsConnectionFactory" />
			</bean>
		</property>
	</bean>

	<bean id="defaultResponseDestination" class="org.springframework.jndi.JndiObjectFactoryBean">
		<property name="jndiName" value="jms/cds/CdsResponseQueue" />
	</bean>

	<!-- JMS Template that wraps the Topic that the Async test will listen on for the acknowledgements of processing by CDS -->
	<bean id="responseTopicJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
		<property name="connectionFactory" ref="cachedCdsConnectionFactory" />
		<property name="defaultDestination" ref="defaultResponseDestination" />
	</bean>

	<bean id="clinicalDataResponse" class="gov.va.med.cds.clinicaldata.vhim400.ClinicalDataResponse400" />

	<bean id="pooledConnectionUnwrapper" class="gov.va.med.cds.persistence.WeblogicPooledCacheConnectionUnwrapper" />
</beans>
