2

Castle Windsorでいくつかのプロジェクトを行っていますが、構成ファイルのインターセプターフックに問題がありますIProxyGenerationHook

public class LoggingProxyGenerationHook : IProxyGenerationHook
{

    #region IProxyGenerationHook Members

    public void MethodsInspected()
    {
        //throw new Exception("The method or operation is not implemented.");
    }

    public void NonVirtualMemberNotification(Type type, System.Reflection.MemberInfo memberInfo)
    {
        //throw new Exception("The method or operation is not implemented.");
    }

    public bool ShouldInterceptMethod(Type type, System.Reflection.MethodInfo methodInfo)
    {
        return methodInfo.Name.StartsWith("Save", StringComparison.Ordinal);
    }

    #endregion
}

名前が「保存」で始まるメソッドをインターセプトし、構成ファイルに動的にフックするだけです。また、設定ファイルには次のものがあります。

<component id="LoggingAspect" type="DynamicInterceptor.LoggingAspect, DynamicInterceptor"></component>
<component id="LoggingProxyGenerationHook" type="DynamicInterceptor.LoggingProxyGenerationHook, DynamicInterceptor"></component>
<component id="TestClass1" type="TestClasses.TestClass1, TestClasses">
<interceptors hook ="${LoggingProxyGenerationHook}">
<interceptor>${LoggingAspect}</interceptor>
</interceptors>
</component>

設定ファイルで何か間違ったことをしていると思います。何か案は?

4

0 に答える 0