<?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"/>
    </sectionGroup>
  </configSections>

  <spring>

    <context>
      <resource uri="config://spring/objects"/>
    </context>

    <objects xmlns="http://www.springframework.net">
      <description>An example that demonstrates use of AutoProxy functionality.</description>

      <!-- Services definitions -->
      
      <object id="myServiceCommand" type="Spring.AopQuickStart.Commands.ServiceCommand, Spring.AopQuickStart.Common"/>

      <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"/>
        </property>
        <property name="MappedNames">
          <list>
            <value>*Execute</value>
          </list>
        </property>
      </object>

      <!-- Using ObjectNameAutoProxyCreator -->
      <!-- Apply 'aroundAdvisor' on all objects with id that ends by 'Command' -->
      <object type="Spring.Aop.Framework.AutoProxy.ObjectNameAutoProxyCreator, Spring.Aop">
        <property name="ObjectNames">
          <list>
            <value>*Command</value>
          </list>
        </property>
        <property name="InterceptorNames">
          <list>
            <value>aroundAdvisor</value>
          </list>
        </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" />-->

    </objects>

  </spring>

</configuration>
