iamberry-app-api-ioc.xml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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:context="http://www.springframework.org/schema/context"
  5. xmlns:ehcache="http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring"
  6. xmlns:cache="http://www.springframework.org/schema/cache"
  7. xmlns:tx="http://www.springframework.org/schema/tx"
  8. default-autowire="byName"
  9. default-lazy-init="true"
  10. xmlns:task="http://www.springframework.org/schema/task"
  11. xmlns:aop="http://www.springframework.org/schema/aop"
  12. xmlns:ehcache-spring="http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring"
  13. xmlns:p="http://www.springframework.org/schema/p"
  14. xmlns:websocket="http://www.springframework.org/schema/websocket"
  15. xsi:schemaLocation=
  16. "http://www.springframework.org/schema/aop
  17. http://www.springframework.org/schema/aop/spring-aop-4.1.xsd
  18. http://www.springframework.org/schema/beans
  19. http://www.springframework.org/schema/beans/spring-beans.xsd
  20. http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring
  21. http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring/ehcache-spring-1.1.xsd
  22. http://www.springframework.org/schema/cache
  23. http://www.springframework.org/schema/cache/spring-cache-4.1.xsd
  24. http://www.springframework.org/schema/tx
  25. http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
  26. http://www.springframework.org/schema/task
  27. http://www.springframework.org/schema/task/spring-task-3.1.xsd
  28. http://www.springframework.org/schema/websocket
  29. http://www.springframework.org/schema/websocket/spring-websocket.xsd
  30. http://www.springframework.org/schema/context
  31. http://www.springframework.org/schema/context/spring-context-3.2.xsd">
  32. <context:component-scan base-package="com.iamberry.app.international" />
  33. <!-- 配置自动扫描的包:不扫描控制器和异常处理 -->
  34. <context:component-scan base-package="com.iamberry">
  35. <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
  36. <context:exclude-filter type="annotation" expression="org.springframework.web.bind.annotation.ControllerAdvice" />
  37. </context:component-scan>
  38. <!-- 使用CGLIB动态代理 -->
  39. <aop:aspectj-autoproxy proxy-target-class="true"/>
  40. <!-- 开启这个配置,spring才能识别@Scheduled注解 -->
  41. <task:annotation-driven/>
  42. <!-- 配置数据库 -->
  43. <import resource="classpath:iamberry-app-api-datasource.xml"/>
  44. <!-- spring监控 -->
  45. <bean id="druid-stat-interceptor" class="com.alibaba.druid.support.spring.stat.DruidStatInterceptor">
  46. </bean>
  47. <bean id="druid-stat-pointcut" class="org.springframework.aop.support.JdkRegexpMethodPointcut" scope="prototype">
  48. <property name="patterns">
  49. <list>
  50. <value>com.iamberry.app.service.*</value>
  51. <value>com.iamberry.app.mapper.*</value>
  52. </list>
  53. </property>
  54. </bean>
  55. <aop:config proxy-target-class="true">
  56. <aop:advisor advice-ref="druid-stat-interceptor" pointcut-ref="druid-stat-pointcut" />
  57. </aop:config>
  58. </beans>