Advertisement
Guest User

application-context.xml

a guest
May 22nd, 2013
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 4.03 KB | None | 0 0
  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:p="http://www.springframework.org/schema/p"
  5.       xmlns:aop="http://www.springframework.org/schema/aop"
  6.       xmlns:tx="http://www.springframework.org/schema/tx"
  7.       xmlns:context="http://www.springframework.org/schema/context"
  8.       xmlns:jee="http://www.springframework.org/schema/jee"
  9.       xmlns:mvc="http://www.springframework.org/schema/mvc"
  10.       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
  11.       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
  12.       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
  13.       http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd
  14.       http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
  15.       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
  16.  
  17.     <context:component-scan base-package="admin.mangedbean" use-default-filters="false">
  18.         <context:include-filter expression="org.springframework.stereotype.Controller" type="annotation"/>
  19.         <context:include-filter expression="org.springframework.web.bind.annotation.ControllerAdvice" type="annotation"/>  
  20.     </context:component-scan>
  21.     <mvc:annotation-driven/>
  22.     <context:annotation-config/>
  23.    
  24. <!--    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
  25.        <property name="targetClass" value="org.springframework.security.core.context.SecurityContextHolder"/>
  26.        <property name="targetMethod" value="setStrategyName"/>
  27.        <property name="arguments"><list><value>MODE_INHERITABLETHREADLOCAL</value></list></property>
  28.    </bean>-->
  29.    
  30.     <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>            
  31.     <jee:jndi-lookup jndi-name="jdbc/social_networking" id="dataSourceJNDI" lookup-on-startup="false" proxy-interface="javax.sql.DataSource" cache="true" resource-ref="true" />
  32.    
  33.     <bean class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" id="entityManagerFactory" >
  34.         <property name="jpaProperties">
  35.             <props>
  36.                 <prop key="hibernate.enable_lazy_load_no_trans">true</prop>
  37.             </props>
  38.         </property>
  39.        
  40.         <property name="jpaPropertyMap">
  41.             <map>
  42.               <entry key="eclipselink.weaving" value="false"/>
  43.             </map>
  44.         </property>
  45.        
  46.         <property name="loadTimeWeaver">
  47.             <bean class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver"/>
  48.         </property>
  49.        
  50.         <!--The above activates the weaving, since it's a great improve in performance.
  51.            add this option to your JVM :
  52.            javaagent:/path-to-your-javaagent/org.springframework.instrument-3.2.2.RELEASE.jar
  53.            
  54.            In Spring 3.x the javaagent is localized in the org.springframework.instrument jar.
  55.            You need the org.springframework.instrument library together with aspectjrj.jar & aspectjweaver.jar librairies.
  56.        -->
  57.     </bean>
  58.    
  59.     <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
  60.         <property name="entityManagerFactory" ref="entityManagerFactory"/>
  61.     </bean>
  62.  
  63.     <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean" lazy-init="true">
  64.         <property name="dataSource" ref="dataSourceJNDI" />
  65.    </bean>
  66.     <tx:annotation-driven transaction-manager="transactionManager"/>
  67.    
  68.     <bean id="testService" class="admin.dao.TestDAO"/>
  69.     <bean id="stateService" class="admin.dao.StateDAO"/>
  70.     <bean id="sharableService" class="admin.dao.SharableDAO"/>
  71.  
  72. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement