Clover.NET coverage report - Coverage for s2container.net

Coverage timestamp: 2006年5月30日 11:21:29

File Stats: LOC: 57   Methods: 2
NCLOC: 37 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
Seasar.Framework.Aop\Impl\DynamicAopProxyAspectWeaver.cs 0.0% 0.0% 0.0% 0.0%
coverage
1   using System;
2   using System.Collections;
3   using Seasar.Framework.Container;
4   using Seasar.Framework.Aop.Proxy;
5  
6   namespace Seasar.Framework.Aop.Impl
7   {
8   /// <summary>
9   /// DynamicAopProxyを用いてAspectを織り込む処理を持つクラス
10   /// </summary>
11   public class DynamicAopProxyAspectWeaver : AbstractAspectWeaver
12   {
13   /// <summary>
14   /// AopProxyを用いてAspectを織り込む
15   /// </summary>
16   /// <param name="target">Aspectを織り込む対象のオブジェクト</param>
17   /// <param name="componentDef">Aspectを織り込む対象のコンポーネント定義</param>
18 0 public override void WeaveAspect(ref object target, Seasar.Framework.Container.IComponentDef componentDef)
19   {
20   if (componentDef.AspectDefSize == 0) return;
21   Hashtable parameters = new Hashtable();
22   parameters[ContainerConstants.COMPONENT_DEF_NAME] = componentDef;
23  
24   Type[] interfaces = componentDef.ComponentType.GetInterfaces();
25  
26   if (!componentDef.ComponentType.IsInterface)
27   {
28   DynamicAopProxy aopProxy = new DynamicAopProxy(componentDef.ComponentType,
29   GetAspects(componentDef), parameters, target);
30   target = aopProxy.Create();
31   }
32   else
33   {
34   this.AddProxy(ref target, componentDef, componentDef.ComponentType, parameters);
35   }
36  
37   foreach (Type interfaceType in interfaces)
38   {
39   this.AddProxy(ref target, componentDef, interfaceType, parameters);
40   }
41   }
42  
43   /// <summary>
44   /// コンポーネント定義にProxyを追加する
45   /// </summary>
46   /// <param name="target">Aspectを織り込む対象のオブジェクト</param>
47   /// <param name="componentDef">Aspectを織り込む対象のコンポーネント定義</param>
48   /// <param name="type">コンポーネント定義に追加するProxyのType</param>
49 0 protected void AddProxy(ref object target, IComponentDef componentDef, Type type, Hashtable parameters)
50   {
51   DynamicAopProxy aopProxy = new DynamicAopProxy(type,
52   GetAspects(componentDef), parameters, target);
53   componentDef.AddProxy(type, aopProxy.Create());
54   }
55   }
56   }
57