Autofac 之 基于 Castle DynamicProxy2 的 Interceptor 功能
var builder = new ContainerBuilder();
builder.RegisterType<SomeType>()
.As<ISomeInterface>()
.EnableInterfaceInterceptors();
builder.Register(c => new CallLogger(Console.Out));
var container = builder.Build();
var willBeIntercepted = container.Resolve<ISomeInterface>();
var builder = new ContainerBuilder();
builder.RegisterType<First>()
.EnableClassInterceptors();
builder.Register(c => new CallLogger(Console.Out));
var cb = new ContainerBuilder();
cb.RegisterType<TestServiceInterceptor>();
cb.Register(c => CreateChannelFactory()).SingleInstance();
cb.Register(c => c.Resolve<ChannelFactory<ITestService>>().CreateChannel())
.InterceptTransparentProxy(typeof(IClientChannel))
.InterceptedBy(typeof(TestServiceInterceptor))
.UseWcfSafeRelease();
实战一下
先看看基于接口的拦截器:
我们先定义一个借口,名为 ICalculater:
using Autofac.Extras.DynamicProxy2; namespace AOP.Interceptors
{
//[Intercept(typeof(CalculaterInterceptor))]
public interface ICalculater
{
int Add(int x, int y); int Sub(int x, int y);
}
}
然后定义该接口的实现类 Calculater:
using Autofac.Extras.DynamicProxy2; namespace AOP.Interceptors
{
//[Intercept(typeof(CalculaterInterceptor))]
public class Calculater : ICalculater
{
public int Add(int x, int y)
{
return x + y;
} public int Sub(int x, int y)
{
return x - y;
}
}
}
接下来,我们来定义拦截器。这里我们定义了两个连接器,通过这两个拦截器,我们将能很清晰的看到拦截器是如何工作的。
定义第一个拦截器 CalculaterInterceptor :
using System;
using Castle.DynamicProxy; namespace AOP.Interceptors
{
public class CalculaterInterceptor : IInterceptor
{
public void Intercept(IInvocation invocation)
{
// 在下个拦截器或目前方法处理之前处理
var args = invocation.Arguments; Console.WriteLine($"Before: x={args[0]}, y={args[1]}");
Console.WriteLine($"Before: Method={invocation.Method.Name}"); invocation.SetArgumentValue(, ); // handle
invocation.Proceed(); // 调用下一个拦截器,直到最终的目标方法。 // Post
Console.WriteLine($"After: TargetType={invocation.TargetType}");
Console.WriteLine($"After: ReturnValue={invocation.ReturnValue}"); invocation.ReturnValue = (int)invocation.ReturnValue - ;
}
}
}
定义第二个拦截器 CalculaterInterceptor2 :
using System;
using Castle.DynamicProxy; namespace AOP.Interceptors
{
public class CalculaterInterceptor2 : IInterceptor
{
public void Intercept(IInvocation invocation)
{
var args = invocation.Arguments; Console.WriteLine($"Before2: x={args[0]}, y={args[1]}");
Console.WriteLine($"Before2: Method={invocation.Method.Name}"); invocation.Proceed(); Console.WriteLine($"After2: TargetType={invocation.TargetType}");
Console.WriteLine($"After2: ReturnValue={invocation.ReturnValue}"); invocation.ReturnValue = (int)invocation.ReturnValue - ; // 将结果值减去 2
}
}
}
在 控制台 Main 函数输入我们的结果:
static void Main(string[] args)
{
var builder = new ContainerBuilder();
builder.RegisterType<Calculater>()
.As<ICalculater>()
.EnableInterfaceInterceptors()
.InterceptedBy(typeof(CalculaterInterceptor), typeof(CalculaterInterceptor2)); // 这里定义了两个拦截器,注意它们的顺序 builder.RegisterType<CalculaterInterceptor>(); // 注册拦截器
builder.RegisterType<CalculaterInterceptor2>(); // 注册拦截器2 var ioc = builder.Build(); var calculater = ioc.Resolve<ICalculater>();
var addResult = calculater.Add(, ); Console.WriteLine($"add result: {addResult}"); Console.WriteLine("-------------------");
Console.ReadLine();
}
我们看看输出结果:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAewAAADrCAIAAAAkOjI7AAAgAElEQVR4nOy9Z1RbSZ7/Xbz5+/j47Dn74jnP8+K/u9NhutvtRAbbZDAOmByNyTnnLAnlnHMEIQQIgUAgcjZO3e2O07M7m+bZ3end6enZmc7Tszv7/N88L+pKSCggMG5jT33P93CurkpVda/E59b9Vd0q8Jd/+ZenTp9hcbjziytEGtvhQSp7kMqCJlBZBAoTT2biyIwBEn2ASO8n0vuJtH4irZ/IGCAxB8gsPJWNp3IGaVwig0dk8oh0HpHBJzEFZKaAyhHTuGI6V0rnyxgCGUuoYAmVbKGS5W6BgimQM/lyBk/G4EnpXCmdJ6XzZAy+jMGXOTYYfBkdvsuV0rkSOld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/ftO/ET/lrOLAI4PYD9V2in4cADnMe/Mzfz3J95+n7VPiTuf/HddhyfefjsT7e3vJn/49ZH2/5H1gE8HQa3T/iz0EdKh/g/af4NOcH6fh16vSZb775dmZ+cWZ+wWJdmJ61Tc3OT83M/eM//xI9semQ+6/8RyjoRyjuz1DofCK9bDp1+sw33347t7g8t7A8O784O79omVuwWG3/9Mv/F0HcWc+0cXFgMwpx51iEzifSS6hTp898++13tqXV+cWV+cWVuYVlq21pdn7xn3/5LwjiSEhISCddp06f+fa77xZXNxZX1heW12zLq/OLK3OLy7/8l39FEEdCQkI66Tp1+sx3332/srG1sra5vLa5tLaxuLK+uLz2L//6bwjiSEhISCddEOJrm9urG1sr6xDlG0urG//yb79CEEdCQkI66Tp1+sx333+/sX1vfWtnbXNnbXN7dWN7dWPr3371GYI4EhIS0knXqdNnvv/+D9v3Hmzdu7+5s7uxfW9j+97G1r1fffbvaD7xY9cRhio+68qfnJODhIR0FJ06feb7P/xh5/7D7d0H2/fub927v7Vzf3Nn91f//h8vwXziR8vq2eHsyMf1jCB7jOcZCQnp+ejU6TN/+MMPuw/f2X34+N6DR/cePNq5/3Bn9+G//8evX475xA/LqWfKMgRxJCSkYxaE+INH795/9M79h48dKD8axHfd5PEt953eMvS4/1ggfmAlfX/Qd/19nwSPx+UxvbeTcIR8PB6at/ojISG9MDp1+swffvjh4TvvPXj87oPH7z6wo/w/fv35yzGfuMeq+lOfp6m/P2V5O7QDK/CU+XvM+enPMxIS0vPRqdNnfvjhh8fvPnn0zpNH77z36J33Hj5+98Hjd3/9+ecvx3ziPsDq/3H5gKPH+ntL708+B1bgwDx9HNe+t/ZtuJeLhIR00nXq9JkffvjjO08+eOe99x+/9/7jdzGU//rz37wc84l7PITD1uew58Fb+sNueyvlUJ/1oaf5LBIS0onQqdNnfvjjH9/74KP33v/w3fc/fPfJB++89/47773/+W++eDnmE/eYlT/1eUb133WSn8fru1A/6+lRh02PhIR04gQh/uSDj5988NF773/43vsfvvvkg3effPCbL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+GXgbId4dTghxANDAeoj3x7N4oyEhDgBaqNUbl9fvkxCPNxoOJ89fvSHEAaDq7kLcnfedWbRHpTeaEuIAoIEoxA1vaWSFeOZ3NvK1jQBQFXGI+0vDXRDiAKCZ7RB3ZtEelReEOABU33qID5z5IArxMSEOADq4C3FvMXDnA2feH0/74+mLc36xCQCVF4W46a9MQhwAtJMV4jNCHAD0sBbiS8OdJ7vFCXEA0EAc4sHK9JeGu4h3izuEOADoIB3iA2c2IMQBQAsbIe4tDHdBiAOANqIQt5IQ9+Ld4oQ4AGjgNsRPLH9lroX4GSEOANW3GeLL2xCfE+IAoIGMEHfnA3d+dv4dIQ4AVVerN66u31vhiRWsTG+Z7BYnxAFAA1GI21GI+8tooyEhDgB6IMQBQGNJiNtrIW64C0IcADRwG+KndnBiRSHuLQyPEAcAHRDiAKAxQhwANEaIA4DG4hCfRCG+Sv74/uw1IQ4AlReF+JAQBwAd3YV4SIgDgG6SEB+GJ1YQhfjS9JaEOABoYD3EbUIcAPSyHeIBIQ4A+tgM8ds/vveWZ6+/J8QBoOpSIX5iEeIAoIvsEPcJcQDQQVaIryx/RYgDgAYIcQDQ1/8BY5A4uYFuwHMAAAAASUVORK5CYII=" alt="" />
这里我们可以看出,执行顺序为 CalculaterInterceptor --> CalculaterInterceptor2 --> Target Method --> CalculaterInterceptor2 --> CalculaterInterceptor 。拦截器中 invocation.Proceed() 方法用于调用下一个拦截器(若存在),直到最终的目标方法(Target Method)。不过 invocation.Proceed() 并不是一定要调用的,例如,对于有返回值的目标方法,我们在拦截器中设置 invocation.ReturnValue 值就可正确执行,这样便不会执行目标方法。在有些场景中,如身份验证、缓存读取等还是特别有用的。
当然,在 Main() 方法中 Ioc 注册 Caliculater 类型时我们注册了两个拦截器,".InterceptedBy(typeof(CalculaterInterceptor), typeof(CalculaterInterceptor2))"。我们也可以直接在 Calculater 类型 或 ICalculater 接口上以特性的形式注册,如上面代码中注释掉的那部分。若是既有在类型上注册,也有在 Autofac 的 Builder 中注册,那么这个拦截器会重复执行。
基于类的拦截器:
我们定义两个类 Flight 和其 子类 FlightOfSH:
public class Flight
{
public virtual void Fly(DateTime time)
{
Console.WriteLine($"Flight: {time}");
}
} public class FlightOfSH : Flight
{
public override void Fly(DateTime time)
{
Console.WriteLine($"FlightOfSH: Fly={time}");
} public void Arrive(DateTime time)
{
Console.WriteLine($"FlightOfSH: Arrive={time}");
}
}
这两个类的拦截器:
internal class FlightInterceptor : IInterceptor
{
public void Intercept(IInvocation invocation)
{
Console.WriteLine("Before Fly"); invocation.Proceed(); Console.WriteLine("After Fly");
}
}
var builder = new ContainerBuilder(); builder.RegisterType<Flight>()
.EnableClassInterceptors().InterceptedBy(typeof(FlightInterceptor));
builder.RegisterType<FlightOfSH>()
.EnableClassInterceptors().InterceptedBy(typeof(FlightInterceptor)); builder.RegisterType<FlightInterceptor>(); var ioc = builder.Build(); var flight = ioc.Resolve<Flight>();
flight.Fly(DateTime.Now); var flightOfSH = ioc.Resolve<FlightOfSH>();
flightOfSH.Fly(DateTime.Now);
flightOfSH.Arrive(DateTime.Now);
总结
Autofac 之 基于 Castle DynamicProxy2 的 Interceptor 功能的更多相关文章
- 业务接口+UI层的设计(基于Castle实现的Repository)
业务接口+UI层的设计(基于Castle实现的Repository) Repository层设计的文章见:[http://www.cnblogs.com/yomho/p/3297042.html] ...
- 【Yom框架】漫谈个人框架的设计之三:业务接口+UI层的设计(基于Castle实现的Repository)
Repository层设计的文章见:[http://www.cnblogs.com/yomho/p/3297042.html] 一.概要设计 上面Reposity 应该为 Repository 特 ...
- 新的IRepository接口+搜索和排序解耦(+基于Castle实现)
新的IRepository接口+搜索和排序解耦(+基于Castle实现) 经过了上篇IRepository和IRepository<T>的讨论[文章地址为:http://www.cnblo ...
- 基于STC12C5A的MINI3216多功能点阵时钟
代码地址如下:http://www.demodashi.com/demo/12862.html 基于STC12C5A的MINI3216多功能点阵时钟 硬件详解 PCB 硬件原理图 主控模块 max72 ...
- php基于SQLite实现的分页功能示例
php基于SQLite实现的分页功能. 这里操作数据库文件使用的是前面文章<PHP基于PDO实现的SQLite操作类>中的SQLite数据库操作类. 代码: <?php class ...
- 基于90nm CMOS技术的功能齐全的64Mb DDR3 STT-MRAM
自旋转矩磁阻随机存取存储器(ST-MRAM)有望成为一种快速,高密度的非易失性存储器,可以增强各种应用程序的性能,特别是在用作数据存储中的非易失性缓冲器时设备和系统.为此,everspin开发了基于9 ...
- HMS Core积极探索基于硬件耳返的功能,帮助唱吧整体唱歌延迟率降低60%
唱吧的使命是让唱歌更简单.让生活更美好,其布局的K歌业务专注于让曲库更全.音质更好,开创了同框合唱.弹唱等有意思的游戏类K歌玩法.为了让用户拥有更加沉浸的娱乐体验,唱吧与HMS Core积极探索基于硬 ...
- mysql基于init-connect+binlog完成审计功能
目前社区版本的mysql的审计功能还是比较弱的,基于插件的审计目前存在于Mysql的企业版.Percona和MariaDB上,但是mysql社区版本有提供init-connect选项,基于此我们可以用 ...
- 基于 jQuery Jcrop 插件的功能模块:头像剪裁
/** Jcrop version: 0.9.12 jQuery version: 1.9.0 Author: 小dee Date: 2014.10.30 */ 先看看他山之石:博客园的头像模块也是使 ...
随机推荐
- 读者汇app项目案例源码
这款app是我花一周左右时间做出来的,一款阅读笑话,段子,糗事,脑筋急转弯,神回复,语录,谜语等的休闲娱乐app,用户除了可以浏览他人发布的内容外,自己也可以发布相关内容,和其他人一同分享有趣的内容, ...
- centos 安装mysqldb 记录
vim setup_pofix.py #修改mysql_config路径 <pre> ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /us ...
- Builder 生成器模式
将一个复杂对象的构建与它的表示分离,使得同样的构建过程可以创建不同的表示. 当同时满足以下情况的时候可以使用Builder模式: 当创建复杂对象的算法应该独立于该对象的组成部分以及他们的装配方式. 当 ...
- Java中的I/O流
import java.io.*//生成代表输入流的对象fis=new FileInputStream("e:/src/from.txt") //生成代表输出流的对象 fos=ne ...
- 【原创教程】JavaScript详解之语法和对象
JavaScript的好的想法:函数.弱类型.动态对象和一个富有表现力的对象字面量表示法. JavaScript的坏的想法:基于全局变量的编程模型. 好了,不管他是好的还是坏的,都是我的最爱,下面 ...
- C#中的委托范例学习
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Cons ...
- SQL使用数据库引擎存储过程,系统视图查询,DBA,BI开发人员必备基础知识
在开发过程中会遇到需要弄清楚这个数据库什么时候建的,这个数据库中有多少表,这个存储过程长的什么样子等等信息,今天把自己工作过程中经常用到的一些数据库引擎存储过程,系统视图等等总结一下以备不时之用.下面 ...
- iOS 地图坐标系之间的转换WGS-84世界标准坐标、GCJ-02中国国测局(火星坐标,高德地图)、BD-09百度坐标系转换
开发过程中遇到地图定位不准确,存在偏差.首先确认你获取到的坐标所在坐标系跟地图数据是不是相匹配的. 常用的地图SDK:高德地图使用的是GCJ-02(也就是火星坐标系),百度使用的是BD-09百度坐标系 ...
- IOS LocationManager定位国内偏移,火星坐标(GCJ-02)解决方法
转载自:http://blog.csdn.net/swingpyzf/article/details/16972351 纠偏也可参考:http://www.2cto.com/kf/201310/253 ...
- C#程序中获取电脑硬件配置信息的一种方法
本文介绍获取cpu信息和内存信息的方法,根据本文所举例的代码可以举一反三获取更多信息. 获取cpu名称的方法: public string GetCpuInfo() { ManagementObjec ...