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" xmlns:p="http://www.springframework.org/schema/p"
|
4
|
xmlns:jpa="http://www.springframework.org/schema/data/jpa"
|
5
|
xmlns:util="http://www.springframework.org/schema/util" xmlns:cache="http://www.springframework.org/schema/cache"
|
6
|
xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:template="http://dnetlib.eu/springbeans/template"
|
7
|
xmlns:tx="http://www.springframework.org/schema/tx"
|
8
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
9
|
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
|
10
|
http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd
|
11
|
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
|
12
|
http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
|
13
|
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
|
14
|
|
15
|
<bean id="datasourceDao" class="eu.dnetlib.datasource.publisher.clients.DatasourceDao" />
|
16
|
|
17
|
<bean id="datasourceIndexClient" class="eu.dnetlib.datasource.publisher.clients.DatasourceIndexClient" />
|
18
|
|
19
|
<bean id="datasourceIsLookupClient" class="eu.dnetlib.datasource.publisher.clients.ISLookupClient" />
|
20
|
|
21
|
<bean id="mongoLoggerClient" class="eu.dnetlib.datasource.publisher.clients.MongoLoggerClient" />
|
22
|
|
23
|
<bean id="datasourcePublisherMongoClient" class="com.mongodb.MongoClient" scope="singleton">
|
24
|
<constructor-arg index="0" type="com.mongodb.ServerAddress">
|
25
|
<bean class="com.mongodb.ServerAddress">
|
26
|
<constructor-arg index="0" value="${datasource.publisher.mongodb.host}"/>
|
27
|
<constructor-arg index="1" value="${datasource.publisher.mongodb.port}"/>
|
28
|
</bean>
|
29
|
</constructor-arg>
|
30
|
<constructor-arg index="1" type="com.mongodb.MongoClientOptions">
|
31
|
<bean class="eu.dnetlib.datasource.publisher.clients.MongoOptionsFactory"
|
32
|
p:connectionsPerHost="${datasource.publisher.mongodb.connectionsPerHost}"/>
|
33
|
</constructor-arg>
|
34
|
</bean>
|
35
|
|
36
|
<jpa:repositories base-package="eu.dnetlib.datasource.publisher.repository"/>
|
37
|
|
38
|
<!-- DATASOURCE -->
|
39
|
<bean id="dsDataSource"
|
40
|
class="org.springframework.jdbc.datasource.DriverManagerDataSource"
|
41
|
p:driverClassName="org.postgresql.Driver" p:url="${datasource.publisher.jdbc.url}"
|
42
|
p:username="${datasource.publisher.jdbc.user}" p:password="${datasource.publisher.jdbc.pwd}" />
|
43
|
|
44
|
<bean id="entityManagerFactory"
|
45
|
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
|
46
|
<property name="packagesToScan" value="eu.dnetlib.datasource.publisher.model.db" />
|
47
|
<property name="dataSource" ref="dsDataSource" />
|
48
|
<property name="jpaProperties">
|
49
|
<props>
|
50
|
<prop key="hibernate.show_sql">false</prop>
|
51
|
<prop key="hibernate.hbm2ddl.auto">validate</prop>
|
52
|
<prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQL9Dialect</prop>
|
53
|
</props>
|
54
|
</property>
|
55
|
|
56
|
<property name="persistenceProvider">
|
57
|
<bean class="org.hibernate.jpa.HibernatePersistenceProvider"></bean>
|
58
|
</property>
|
59
|
</bean>
|
60
|
|
61
|
<tx:annotation-driven transaction-manager="transactionManager" />
|
62
|
|
63
|
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"
|
64
|
p:entityManagerFactory-ref="entityManagerFactory"
|
65
|
p:dataSource-ref="dsDataSource"
|
66
|
p:jpaDialect-ref="jpaDialect"/>
|
67
|
|
68
|
<bean id="jpaDialect" class="org.springframework.orm.jpa.vendor.HibernateJpaDialect" />
|
69
|
|
70
|
<bean id="datasourceCacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager"
|
71
|
p:cache-manager-ref="datasourceCache" />
|
72
|
|
73
|
<bean id="datasourceCache"
|
74
|
class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"
|
75
|
p:cacheManagerName="datasourceCache"
|
76
|
p:configLocation="classpath:/eu/dnetlib/datasource/publisher/cache/ehcache.xml" />
|
77
|
|
78
|
</beans>
|