Hi there, 
        
The issue IOC-ISSUE-143 was just created by TRAN DINH HUNG (sakura80).
        
        Key: IOC-ISSUE-143
        Summary: Interceptor does not work as expected
        Type: Bug
        Importance: High
        
        Description:
        I have a code like below
[CODE]
    class Program
    {
        static void Main(string[] args)
        {
            WindsorContainer container = new WindsorContainer();
            container.AddComponent("ServiceA", typeof(IServiceA), 
typeof(ServiceA));
            container.AddComponent("interceptorA", typeof(ServiceAInterceptor));
            IHandler handler = container.Kernel.GetHandler(typeof(IServiceA));
            handler.ComponentModel.Interceptors.Add(new 
InterceptorReference("interceptorA"));
            IServiceA serviceA = container.Resolve<IServiceA>();
            serviceA.Method1();
            Console.ReadLine();
        }
    }
    public interface IServiceA
    {
        void Method1();
        void Method2();
    }
    public class ServiceA : IServiceA
    {
        public ServiceA()
        {
        }
        public void Method1()
        {
            Console.WriteLine("Method1 called");
            Method2();
        }
        public void Method2()
        {
            Console.WriteLine("Method2 called");
        }
    }
    public class ServiceAInterceptor : IInterceptor
    {
        public void Intercept(IInvocation invocation)
        {
            Console.WriteLine("Intercept: " + invocation.Method.Name);
            invocation.Proceed();
        }
    }
[/CODE]
Result:
Intercept: Method1
Method1 called
Method2 called (The interceptor does know if Method2 is called by Method1)
Even I mark virtual on both methods, it does not work too.
        
For more, see 
http://support.castleproject.org/projects/IOC/issues/view/IOC-ISSUE-143
 
        
--
donjon
by Castle Stronghold
http://www.castle-donjon.com



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Development List" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to