applicationContext.xml 2.58 KB
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
<?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:context="http://www.springframework.org/schema/context"
xmlns:solr="http://www.springframework.org/schema/data/solr"
xsi:schemaLocation="http://www.springframework.org/schema/data/solr http://www.springframework.org/schema/data/solr/spring-solr.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd

http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

<!--
#####################################
CONTEXT SETTINGS
#####################################
-->
<bean id="configProperties"
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="locations">
<list>
<value>classpath:configuration.properties</value>
<value>classpath:database.properties</value>
<value>classpath:conf.properties</value>
</list>
</property>
</bean>
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer">
<property name="properties" ref="configProperties" />
</bean>
<!--
#####################################
SOLR
#####################################
-->
<bean id="solrServer" class="org.springframework.data.solr.server.support.HttpSolrServerFactoryBean">
<property name="url" value="${solr.host}"/>
<property name="maxConnections" value="${solr.maxConnections}"/>
<property name="timeout" value="${solr.timeout}"/>
</bean>
<bean id="solrTemplate" class="org.springframework.data.solr.core.SolrTemplate">
<constructor-arg ref="solrServer"/>
</bean>

<bean id="searchRepository" class="com.lyms.platform.job.index.repository.SolrProductRepository">
<property name="solrOperations" ref="solrTemplate"/>
</bean>
<bean id="doctorRepository" class="com.lyms.platform.job.index.repository.DoctorUserPatientsMapsRepository">
<property name="solrOperations" ref="solrTemplate"/>
<property name="solrTemplate" ref="solrTemplate"/>
</bean>
<!-- 采用注释的方式配置bean -->
<context:annotation-config />
<context:component-scan base-package="com.lyms.platform.job.index.service"/>
<import resource="applicationContext_biz_patient.xml"/>
<import resource="applicationContext-dal.xml"/>
</beans>