Added TypeNameAutoProxyCreator example to the AOP quick start [SPRNET-924]
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
|
||||
<configSections>
|
||||
<sectionGroup name="spring">
|
||||
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core" />
|
||||
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
|
||||
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
|
||||
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core"/>
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
|
||||
<spring>
|
||||
|
||||
<context>
|
||||
<resource uri="config://spring/objects" />
|
||||
<resource uri="config://spring/objects"/>
|
||||
</context>
|
||||
|
||||
<objects xmlns="http://www.springframework.net">
|
||||
@@ -19,18 +19,16 @@
|
||||
|
||||
<!-- Services definitions -->
|
||||
|
||||
<object id="myServiceCommand"
|
||||
type="Spring.AopQuickStart.Commands.ServiceCommand, Spring.AopQuickStart.Common" />
|
||||
<object id="myServiceCommand" type="Spring.AopQuickStart.Commands.ServiceCommand, Spring.AopQuickStart.Common"/>
|
||||
|
||||
<object id="myAnotherServiceCommand"
|
||||
type="Spring.AopQuickStart.Commands.AnotherServiceCommand, Spring.AopQuickStart.Step7" />
|
||||
<object id="myAnotherServiceCommand" type="Spring.AopQuickStart.Commands.AnotherServiceCommand, Spring.AopQuickStart.Step7"/>
|
||||
|
||||
|
||||
<!-- The rest of the config file is common no matter how many objects you add -->
|
||||
|
||||
<object id="aroundAdvisor" type="Spring.Aop.Support.NameMatchMethodPointcutAdvisor, Spring.Aop">
|
||||
<property name="Advice">
|
||||
<object type="Spring.AopQuickStart.Aspects.ConsoleLoggingAroundAdvice, Spring.AopQuickStart.Common" />
|
||||
<object type="Spring.AopQuickStart.Aspects.ConsoleLoggingAroundAdvice, Spring.AopQuickStart.Common"/>
|
||||
</property>
|
||||
<property name="MappedNames">
|
||||
<list>
|
||||
@@ -54,6 +52,21 @@
|
||||
</property>
|
||||
</object>
|
||||
|
||||
<!-- Or Using TypeNameAutoProxyCreator -->
|
||||
<!-- Apply 'aroundAdvisor' on all objects from namespace 'Spring.AopQuickStart.Commands' -->
|
||||
<!--<object type="Spring.Aop.Framework.AutoProxy.TypeNameAutoProxyCreator, Spring.Aop">
|
||||
<property name="TypeNames">
|
||||
<list>
|
||||
<value>Spring.AopQuickStart.Commands.*</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="InterceptorNames">
|
||||
<list>
|
||||
<value>aroundAdvisor</value>
|
||||
</list>
|
||||
</property>
|
||||
</object>-->
|
||||
|
||||
<!-- Or Using DefaultAdvisorAutoProxyCreator -->
|
||||
<!-- Apply all avalaible IAdvisors to all objects -->
|
||||
<!--<object type="Spring.Aop.Framework.AutoProxy.DefaultAdvisorAutoProxyCreator, Spring.Aop" />-->
|
||||
|
||||
Reference in New Issue
Block a user