I realized that what I do *will* bloat the kernel. I use an 
IModelInterceptorsSelector to create the individual interceptor 
instances, like this:

public InterceptorReference[] SelectInterceptors(ComponentModel model) {
  return weaver.CreateExecutors(model.Implementation) // creates an 
array of IInterceptor instances
    .Select(x => {
              var key = Guid.NewGuid().ToString();
              // register custom IInterceptor instance by name            
              
kernel.Register(Component.For<IAdviceExecutor>().Named(key).Instance(x)); 
              return InterceptorReference.ForKey(key);
            })
    .ToArray();
}

The problem is, that those instances are never removed from the kernel 
anymore, so on the long run if I create a lot of transient proxied 
instances the kernel fills up with more and more named instances of 
IAdviceExecutor (which is derived from IInterceptor).

Each named instance will be used only once, so as soon as it is resolved 
from the kernel it could be removed. Can I hook in somewhere to make 
this happen?

Any help on this is highly appreciated.

Regards,
Andre

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to