1
|
|
#region Copyright
|
2
|
|
|
3
|
|
|
4
|
|
|
5
|
|
|
6
|
|
|
7
|
|
|
8
|
|
|
9
|
|
|
10
|
|
|
11
|
|
|
12
|
|
|
13
|
|
|
14
|
|
|
15
|
|
|
16
|
|
|
17
|
|
#endregion
|
18
|
|
|
19
|
|
using System;
|
20
|
|
using Seasar.Framework.Aop.Impl;
|
21
|
|
using Seasar.Framework.Aop.Proxy;
|
22
|
|
using Seasar.Framework.Container;
|
23
|
|
|
24
|
|
namespace Seasar.Framework.Aop.Interceptors
|
25
|
|
{
|
26
|
|
|
27
|
|
|
28
|
|
|
29
|
|
[Serializable]
|
30
|
|
public abstract class AbstractInterceptor : IMethodInterceptor
|
31
|
|
{
|
32
|
|
const long serialVersionUID = 0L;
|
33
|
|
|
34
|
0
|
public object CreateProxy(Type proxyType)
|
35
|
|
{
|
36
|
|
IAspect aspect = new AspectImpl(this, new PointcutImpl(
|
37
|
|
new string[] { ".*" } ));
|
38
|
|
return new AopProxy(proxyType,
|
39
|
|
new IAspect[] { aspect }).GetTransparentProxy();
|
40
|
|
}
|
41
|
|
|
42
|
0
|
protected IComponentDef GetComponentDef(IMethodInvocation invocation)
|
43
|
|
{
|
44
|
|
if(invocation is IS2MethodInvocation)
|
45
|
|
{
|
46
|
|
IS2MethodInvocation impl = (IS2MethodInvocation) invocation;
|
47
|
|
return (IComponentDef) impl.GetParameter(ContainerConstants.COMPONENT_DEF_NAME);
|
48
|
|
}
|
49
|
|
return null;
|
50
|
|
}
|
51
|
|
|
52
|
|
#region IMethodInterceptor インターフェイス
|
53
|
|
|
54
|
0
|
public virtual object Invoke(IMethodInvocation invocation)
|
55
|
|
{
|
56
|
|
return invocation.Proceed();
|
57
|
|
}
|
58
|
|
|
59
|
|
#endregion
|
60
|
|
|
61
|
|
}
|
62
|
|
}
|
63
|
|
|