The documentation states that you should always make interceptors transitional. If I have this sample code,
//register interceptor container.Register(Classes.FromAssemblyNamed("Sample.Interceptors") .BasedOn<Castle.DynamicProxy.IInterceptor>() .LifestyleTransient()); //Configure components to intercept container.Register(Classes.FromAssemblyNamed("Sample.Component") .IncludeNonPublicTypes().InNamespace("Sample.Component", true) .Configure(c=> c.Interceptors(InterceptorReference.ForType<SampleInterceptor>()) .Anywhere.LifestyleSingleton()) .WithService.DefaultInterfaces() );
Should I worry about freeing up the SampleInterceptor , or will it be released automatically as soon as the service in Sample.Component been released by the container?
SampleInterceptor
Sample.Component
Your transient interceptor will have its life expectancy associated with the object with which you associate it, and will be released when this object is released like any other part of this object graph
Source: https://habr.com/ru/post/919819/More articles:Opencv 2.4.2 Code Explanation - Face Recognition - c ++Add reverse proxy to hero - ruby-on-railsList of running processes in golang, Windows version - goYou need to understand the code below for C # virtual methods - inheritanceHow many instances of static variables declared in a method exist? - c ++jQuery equivalent of Ruby.send () method - jquerymagento adds querystring parameter to CSS and JS - cssLinq to XML - element search - c #I am developing an application similar to fb chat. What structure - play or django? - pythonConvert codons (base 64) to base number 10 - pythonAll Articles