Custom advisors

You can apply custom Spring.NET framework advisors to the directory and activities. First, implement the advisors as described here.

To apply the advisors to a directory implementation, use the DirectoryProxyProvider constructor, accepting the list of advisors.

<object id="directoryProxyProvider" 
        type="Flower.Directory.Host.Default.DirectoryProxyProvider, Flower.Directory.Host.Default">
  <constructor-arg>
    <list element-type="Spring.Aop.IAdvisor, Spring.Aop">
      <object type="Spring.Aop.Support.DefaultPointcutAdvisor, Spring.Aop">
        <property name="Advice">
          <object type="Flower.Directory.Host.Default.Advices.StatsCollector, Flower.Directory.Host.Default">
            <constructor-arg value="00:01:00" />
          </object>
        </property>
        <property name="Order" value="1000" />
      </object>
    </list>
  </constructor-arg>
</object>


To apply the advisors to the activities, set the CustomAdvisors property of the ProcessorSettings.

<object id="processorSettings" type="Flower.Processor.ProcessorSettings, Flower.Processor">
  <property name="CustomAdvisors">
    <list element-type="Spring.Aop.IAdvisor, Spring.Aop">
      <object type="Spring.Aop.Support.DefaultPointcutAdvisor, Spring.Aop">
        <property name="Advice">
          <object type="Flower.Processing.Advices.StatsCollector, Flower.Processing">
            <constructor-arg value="00:01:00" />
          </object>
        </property>
        <property name="Order" value="1000" />
      </object>
    </list>
  </property>
</object>


Applying advisers using the DefaultPointcutAdvisor, keep in mind that the directory proxy provider applies the default advisors with the following orders:
  • Arguments validation (before) - 10.
  • Logging (around) - 10.
  • Processor notification (around) - 20.
  • Processes dispatcher notification (around) - 30.
  • Exceptions shield (after throw) - 10.

The following default advisors are applied to activities:
  • Logging (around) - 10.
  • Retrying (around) - 20.
  • Exceptions handling (around) - 30.
  • Transactions (around) - 40.
  • State saving (around) - 50.

(The higher order, the closer an advice to the target.)

Last edited Jun 28, 2013 at 7:48 AM by dbratus, version 1

Comments

No comments yet.