Project

General

Profile

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="datasourceInfoRetriever" class="eu.dnetlib.datasource.publisher.clients.DatasourceInfoRetriever" />
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

    
49
		<property name="jpaProperties">
50
			<props>
51
				<prop key="hibernate.show_sql">false</prop>
52
				<prop key="hibernate.hbm2ddl.auto">validate</prop>
53
				<prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQL9Dialect</prop>
54
			</props>
55
		</property>
56

    
57
		<property name="persistenceProvider">
58
			<bean class="org.hibernate.jpa.HibernatePersistenceProvider"></bean>
59
		</property>
60
	</bean>
61

    
62
	<tx:annotation-driven transaction-manager="transactionManager" />
63

    
64
	<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"
65
		p:entityManagerFactory-ref="entityManagerFactory"
66
		  p:dataSource-ref="dsDataSource"
67
		  p:jpaDialect-ref="jpaDialect"/>
68

    
69
	<bean id="jpaDialect" class="org.springframework.orm.jpa.vendor.HibernateJpaDialect" />
70

    
71
	<bean id="datasourceCacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager"
72
	      p:cache-manager-ref="datasourceCache" />
73

    
74
	<bean id="datasourceCache"
75
	      class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"
76
	      p:cacheManagerName="datasourceCache"
77
	      p:configLocation="classpath:/eu/dnetlib/datasource/publisher/cache/ehcache.xml" />
78

    
79
</beans>
(2-2/5)