Allan
Allan

Reputation: 21

Windsor Method interception (AOP)

I'm trying to create interceptors for specific methods but I'm having a hard time. I can't bind an aspect to a specific method. I create the faicilities most of examples show but it still doesn't work. Can anyone give me an example of how to do this? I prefer xml conifguration, if possible.

Another question, I have this code:

<component id="SampleAspect"
           service="WindsorSample.Aspect.SampleAspect, WindsorSample" 
           type="WindsorSample.Aspect.SampleAspect, WindsorSample">
</component>

<component id="HtmlTitleRetriever"
           type="WindsorSample.DummyObject, WindsorSample">
  <parameters>
    <interceptors>
      <interceptor>${SampleAspect}</interceptor>
    </interceptors>
  </parameters>
</component>

Then...

IWindsorContainer container = new WindsorContainer(new XmlInterpreter());
IDummyObject retriever = container.Resolve<DummyObject>();
retriever.SomeMethod();

This aspect is not executed. Am I missing something? Am I using the wrong approach for aop?

Thanks

Upvotes: 0

Views: 836

Answers (1)

Krzysztof Kozmic
Krzysztof Kozmic

Reputation: 27374

You can only intercept virtual method, you know that, right?

Upvotes: 2

Related Questions