Interceptorむずかしい2
ひがさんのご指摘どおり、useLookupAdapter を指定してみた。
customizer.dicon の actionCustomizer に
<initMethod name="addCustomizer"> <arg> <component class="org.seasar.framework.container.customizer.AspectCustomizer"> <property name="useLookupAdapter">true</property> <property name="interceptorName">"UserDtoAutoRetrieveInterceptor"</property> <property name="pointcut">"index"</property> </component> </arg> </initMethod>
と追加した。たぶんこれであってるとおもう。AspectCustomizer にブレークポイントを置いて、フィールドuseLookupAdapterがtrueになっているのも確かめた。
しかし、うまくいかない。
Aさんでアクセスしたとき
Interceptor###kizashi.scheduler.dto.UserDto@16c6da9
Action###kizashi.scheduler.dto.UserDto@1da5d65
もう、この時点で違うインスタンスなのだが、Bさんでアクセスしたら、
Interceptor###kizashi.scheduler.dto.UserDto@16c6da9
Action###kizashi.scheduler.dto.UserDto@fa8ba9
そう。Interceptor側は同じインスタンスをさしている。つまりSingletonになっている?
何かがおかしい。