AOP to prerender method

Teedaにおいて、全てのPageクラスの特定メソッドAOPを適用させる方法。

まず、インターセプタを作成します。
TestInterceptor.java

public class TestInterceptor extends AbstractInterceptor {

    private static final long serialVersionUID = 1L;

    public Object invoke(MethodInvocation invocation) throws Throwable {
        System.out.println("### BEGIN TestInterceptor ###");
        Object ret = invocation.proceed();
        System.out.println("### E N D TestInterceptor ###");
        return ret;
    }
}

これを、customizer.diconに登録します。
1.作成インターセプタ登録
2.AspectCustomizer登録
3.CustomizerChainに登録(複数のAspectCustomizerを登録する場合)
※churaで作成されたプロジェクトであれば、pageSupportAspectCustomizerが既に登録されているはずです。
customizer.dicon

<!-- 1. -->
<component name="testInterceptor" class="example.TestInterceptor" />

<!-- 2. -->
<component name="testCustomizer"
   class="org.seasar.framework.container.customizer.AspectCustomizer">
  <initMethod name="addInterceptorName">
    <arg>"testInterceptor"</arg> <!-- 1.のインターセプタ -->
  </initMethod>
  <property name="pointcut">"prerender"</property> <!-- prerender指定 -->
</component>

<!-- 3. -->
<component name="pageCustomizer" class="org.seasar.framework.container.customizer.CustomizerChain">
  <initMethod name="addCustomizer">
    <arg>pageSupportAspectCustomizer</arg> <!-- 既に登録されている -->
  </initMethod>
  <initMethod name="addCustomizer">
    <arg>testCustomizer</arg> <!-- 2.で登録したcustomizer -->
  </initMethod>
</component>

これで、Pageクラスのprerenderメソッドが呼ばれる度に

### BEGIN TestInterceptor ###
### E N D TestInterceptor ###

が出力されるのが確認出来ます。