iamberry-app-api-ioc.xml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. <!-- 配置自动扫描的包:不扫描控制器和异常处理 -->
  33. <context:component-scan base-package="com.iamberry">
  34. <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
  35. <context:exclude-filter type="annotation" expression="org.springframework.web.bind.annotation.ControllerAdvice" />
  36. </context:component-scan>
  37. <!-- 使用CGLIB动态代理 -->
  38. <aop:aspectj-autoproxy proxy-target-class="true"/>
  39. <!-- 开启这个配置,spring才能识别@Scheduled注解 -->
  40. <task:annotation-driven executor="myExecutor"
  41. scheduler="myScheduler" />
  42. <task:executor id="myExecutor" pool-size="5" />
  43. <task:scheduler id="myScheduler" pool-size="10" />
  44. <!-- 通过Dubbo 完成SOA -->
  45. <import resource="classpath:iamberry-app-api-consumer.xml"/>
  46. </beans>