aspectj-context.xml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
  5. <bean id="aspectJSecurityInterceptor"
  6. class="org.springframework.security.access.intercept.aspectj.AspectJSecurityInterceptor">
  7. <property name="authenticationManager" ref="authenticationManager" />
  8. <property name="accessDecisionManager" ref="accessDecisionManager" />
  9. <property name="securityMetadataSource">
  10. <bean
  11. class="org.springframework.security.access.annotation.SecuredAnnotationSecurityMetadataSource" />
  12. </property>
  13. </bean>
  14. <bean id="authenticationManager"
  15. class="org.springframework.security.authentication.ProviderManager">
  16. <property name="providers">
  17. <bean
  18. class="org.springframework.security.authentication.TestingAuthenticationProvider" />
  19. </property>
  20. </bean>
  21. <bean id="accessDecisionManager"
  22. class="org.springframework.security.access.vote.AffirmativeBased">
  23. <property name="decisionVoters">
  24. <list>
  25. <bean
  26. class="org.springframework.security.access.vote.RoleVoter" />
  27. </list>
  28. </property>
  29. </bean>
  30. <bean
  31. class="org.springframework.security.access.intercept.aspectj.aspect.AnnotationSecurityAspect"
  32. factory-method="aspectOf">
  33. <property name="securityInterceptor" ref="aspectJSecurityInterceptor" />
  34. </bean>
  35. <bean class="sample.aspectj.Service" />
  36. <bean class="sample.aspectj.SecuredService" />
  37. </beans>