/// <summary> /// Generates a proxy implementing all the specified interfaces and /// redirecting method invocations to the specifed interceptor. /// This proxy is for object different from IList or ICollection /// </summary> /// <param name="targetType">The target type</param> /// <param name="interceptor">The interceptor.</param> /// <param name="argumentsForConstructor">The arguments for constructor.</param> /// <returns></returns> public override object CreateClassProxy(Type targetType, IInterceptor interceptor, params object[] argumentsForConstructor) { try { System.Type proxyType = null; lock (_cachedProxyTypes.SyncRoot) { proxyType = _cachedProxyTypes[targetType] as System.Type; if (proxyType == null) { proxyType = ProxyBuilder.CreateClassProxy(targetType); _cachedProxyTypes[targetType] = proxyType; } } return(CreateClassProxyInstance(proxyType, interceptor, argumentsForConstructor)); } catch (Exception e) { _log.Error("Castle Dynamic Class-Proxy Generator failed", e); throw new IBatisException("Castle Proxy Generator failed", e); } }