I have a (prototype) class belonging to Spring.NET content created using AutoProxy with runtime constructor arguments. It is created in this way.
var context = ContextRegistry.GetContext();
var myClass = context.GetObject("myclass", new object[]{ myRuntimeConstructorArgument }) as MyClass;
This class has some internal logic in which it captures an event that is processed by a class method, for example:
public class MyClass {
private InnerObject innerobject;
public MyClass(ObjectNotOwnedBySpring myRuntimeConstructorArgument) {
...
this.innerobject = new InnerObject();
this.innerobject.SomeEvent += this.handleSomeEvent;
}
public virtual void handleMyEvent (object sender, EventArgs args)
{
}
}
I am trying to use AOP to remove an abstraction leak (caused by an error in an external component) by intercepting the handleMyEvent method. Because Spring.Aop uses a proxy approach to intercept method calls, internal method calls are not intercepted. I get this part.
, , InheritanceBasedAopConfigurer, 'true' . :
.
, !
, InheritanceBasedAopConfigurer runtime:
Spring.Objects.Factory.ObjectCreationException: 'myclass' > , ' [ spring -aop-config.xml] 36': .
InheritanceBasedAopConfigurer? InheritanceBasedAopConfigurer?