1. <!-- UserController -->
  2. <!-- 1. put the UserController.cfc into the ColdSpring framework under the name of UserController -->
  3. <bean id="UserController" class="&applicationMapping;controller.UserController" singleton="true" autowire="byName" />
  4. <!-- UserService PROXIED BY COLDSPRING -->
  5. <!-- 2. put the UserService.cfc into the ColdSpring framework under the name of TargetUserService -->
  6. <bean id="TargetUserService" class="&applicationMapping;model.UserService" singleton="true" autowire="byName" />
  7. <!-- I am the Proxy for the UserService.cfc. -->
  8. <!-- 3. then take the TargetUserService (the real UserService.cfc) and register it in to the ColdSpring framework under the name UserService, this is the proxy -->
  9. <bean id="UserService" class="coldspring.aop.framework.ProxyFactoryBean">
  10.     <property name="target">
  11.         <ref bean="TargetUserService" />
  12.     </property>
  13.     <property name="interceptorNames">
  14.         <list>
  15.             <value>securityAdvisor</value>
  16.             <value>validationAdvisor</value>
  17.         </list>
  18.     </property>
  19. </bean>
  20. <!--
  21. Description: I am the Validation.cfc managed by ColdSpring
  22. -->
  23. <!-- 4. register the Validation.cfc into the CS framework -->
  24. <bean id="Validation" class="&applicationMapping;aspects.Validation" singleton="true" autowire="byName" />
  25. <!--
  26. Desicription: I wrap specific method calls to BlogService with validation
  27. -->
  28. <!-- 5. then the neat stuff: make a MethodIntercepter and make it point to the Validation.cfc and tell it that when ever updateUser is being called make sure you intercept it and run some code. -->
  29. <bean id="validationAdvisor" class="coldspring.aop.support.NamedMethodPointcutAdvisor">
  30.     <property name="advice">
  31.         <ref bean="Validation" />
  32.     </property>
  33.     <property name="mappedNames">
  34.         <value>updateUser</value>
  35.     </property>
  36. </bean>