List of usage examples for org.apache.ibatis.plugin InterceptorChain InterceptorChain
InterceptorChain
From source file:tk.mybatis.mapper.mapperhelper.MapperOnceInterceptor.java
License:Open Source License
/** * ?Mapper?//from w w w. ja v a2 s.co m * * @param invocation */ public synchronized void processInvocation(Invocation invocation) { if (!hasRan) { Object[] objects = invocation.getArgs(); MappedStatement ms = (MappedStatement) objects[0]; mapperHelper.processConfiguration(ms.getConfiguration()); //? InterceptorChain interceptorChain = new InterceptorChain(); List<Interceptor> interceptorList = ms.getConfiguration().getInterceptors(); for (Interceptor interceptor : interceptorList) { if (interceptor != this) { interceptorChain.addInterceptor(interceptor); } } MetaObject metaObject = SystemMetaObject.forObject(ms.getConfiguration()); metaObject.setValue("interceptorChain", interceptorChain); hasRan = true; } }