application-context.xml 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:tx="http://www.springframework.org/schema/tx"
  5. xmlns:context="http://www.springframework.org/schema/context"
  6. xsi:schemaLocation="http://www.springframework.org/schema/beans
  7. http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
  8. http://www.springframework.org/schema/tx
  9. http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
  10. http://www.springframework.org/schema/context
  11. http://www.springframework.org/schema/context/spring-context-2.5.xsd">
  12. <context:component-scan base-package="org.es" />
  13. <bean id="elasticDataSource" class="org.es.jdbc.api.ElasticSingleConnectionDataSource" destroy-method="destroy">
  14. <property name="driverClassName" value="org.es.jdbc.api.ElasticDriver" />
  15. <property name="url" value="jdbc:elastic:192.168.0.109:9300/lu-search-cluster" />
  16. <property name="suppressClose" value="true" />
  17. </bean>
  18. <bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
  19. <property name="dataSource" ref="elasticDataSource" />
  20. <property name="configLocation" value="classpath:sqlMapConfig.xml"/>
  21. </bean>
  22. <bean id="sqlMapClientTemplate" class="org.es.spring.ElasticSqlMapClientTemplate">
  23. <property name="sqlMapClient" ref="sqlMapClient"/>
  24. </bean>
  25. </beans>