<?xml version="1.0" encoding="utf-8" ?>
<objects 
  xmlns="http://www.springframework.net"
  xmlns:r="http://www.springframework.net/remoting">

  <!-- server -->

  <object id="singletonCounter" type="Spring.Remoting.SimpleCounter, Spring.Services.Tests">
    <constructor-arg index="0" value="1" />
  </object>

  <r:saoExporter targetName="singletonCounter" serviceName="RemotedSaoSingletonCounter"/>

  <!--
		Old fashion way without remoting config parser...
  <object type="Spring.Remoting.SaoExporter, Spring.Services">
    <property name="TargetName" value="singletonCounter" />
    <property name="ServiceName" value="RemotedSaoSingletonCounter" />
  </object>
  -->

  
  <!-- client -->
  <!-- remoteSaoSingletonCounter -->
  <r:saoFactory id="remoteSaoSingletonCounter"
                serviceInterface="Spring.Remoting.ISimpleCounter, Spring.Services.Tests"
                serviceUrl="tcp://localhost:8005/RemotedSaoSingletonCounter"/>
               
              

  
	<!--	Old fashion way without remoting config parser... -->
  <!--
  <object id="remoteCounter" type="Spring.Remoting.SaoFactoryObject, Spring.Services">
    <property name="ServiceInterface" value="Spring.Remoting.ISimpleCounter, Spring.Services.Tests" />
    <property name="ServiceUrl" value="tcp://localhost:8005/RemotedSaoSingletonCounter" />
  </object>
  -->
  
  
  <object id="remoteCounter" type="Spring.Aop.Framework.ProxyFactoryObject, Spring.Aop">
    <property name="target" ref="remoteSaoSingletonCounter"/>
    <property name="interceptorNames">
      <list>
        <value>countAdvisor</value>
      </list>
    </property>
    <property name="ProxyInterfaces">
      <list>
        <value>Spring.Remoting.ISimpleCounter, Spring.Services.Tests</value>
      </list>
    </property>
  </object> 
  
  
  <!-- NOTE - CAN NOT USE AUTO PROXY CREATOR FOR SAO SINCE CAN'T QUERY USING REFLECTION FOR
       IMPLEMENTED INTERFACES ON TRANSPARENT PROXY -->
  <!--
  <object id="autoProxyCreator"
        type="Spring.Aop.Framework.AutoProxy.ObjectNameAutoProxyCreator, Spring.Aop">
    <property name="ObjectNames">
      <list>
        <value>remoteCounter</value>
      </list>
    </property>
    <property name="interceptorNames">
      <list>
        <value>countAdvisor</value>
      </list>
    </property>
  </object>
  -->
  

  <object id="countAdvisor" type="Spring.Aop.Support.RegularExpressionMethodPointcutAdvisor, Spring.Aop">
    <property name="pattern" value=".*Count.*"/>
    <property name="advice" ref="countingBeforeAdvice"/>
  </object>
  <object id="countingBeforeAdvice" type="Spring.Aop.Framework.CountingBeforeAdvice"/>

</objects>