-
<!-- UserController -->
-
<!-- 1. put the UserController.cfc into the ColdSpring framework under the name of UserController -->
-
<bean id="UserController" class="&applicationMapping;controller.UserController" singleton="true" autowire="byName" />
-
<!-- UserService PROXIED BY COLDSPRING -->
-
<!-- 2. put the UserService.cfc into the ColdSpring framework under the name of TargetUserService -->
-
<bean id="TargetUserService" class="&applicationMapping;model.UserService" singleton="true" autowire="byName" />
-
<!-- I am the Proxy for the UserService.cfc. -->
-
<!-- 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 -->
-
<bean id="UserService" class="coldspring.aop.framework.ProxyFactoryBean">
-
<property name="target">
-
<ref bean="TargetUserService" />
-
</property>
-
<property name="interceptorNames">
-
<list>
-
<value>securityAdvisor</value>
-
<value>validationAdvisor</value>
-
</list>
-
</property>
-
</bean>
-
<!--
-
Description: I am the Validation.cfc managed by ColdSpring
-
-->
-
<!-- 4. register the Validation.cfc into the CS framework -->
-
<bean id="Validation" class="&applicationMapping;aspects.Validation" singleton="true" autowire="byName" />
-
<!--
-
Desicription: I wrap specific method calls to BlogService with validation
-
-->
-
<!-- 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. -->
-
<bean id="validationAdvisor" class="coldspring.aop.support.NamedMethodPointcutAdvisor">
-
<property name="advice">
-
<ref bean="Validation" />
-
</property>
-
<property name="mappedNames">
-
<value>updateUser</value>
-
</property>
-
</bean>