我想我已经配置按照如下配置好了,且放入jboss4.2,也无异常,但是调用 lifeCycle 的方法时却没有任何拦截器反应???
配置文件:<enterprise-beans>
<session>
<ejb-name>lifeCycle</ejb-name>
<remote>lifecycle.ILifeCycle</remote>
<local>lifecycle.ILifeCycle</local>
<ejb-class>lifecycle.LifeCycle</ejb-class>
<session-type>Stateful</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
<assembly-descriptor>
<interceptor-binding>
<ejb-name>lifeCycle</ejb-name>
<interceptor-class>lifecycle.Inv</interceptor-class>
</interceptor-binding>
</assembly-descriptor>拦截器源代码:
package lifecycle;import javax.interceptor.InvocationContext;public class Inv
{
public Object invoke(InvocationContext ctx) throws Exception
{
System.out.println("invoke");
long start = System.currentTimeMillis();
try
{
if (ctx.getMethod().getName().equals("say"))
{
System.out.println("*** say 已经被调用! *** ");
}

return ctx.proceed();
}
catch (Exception e)
{
throw e;
}
finally
{
long time = System.currentTimeMillis() - start;
System.out.println("用时:" + time + "ms");
} }
}我用了针对类的拦截与类方法的拦截都无效果,请问怎么回事?谢谢。
另在配置文件中发现 session 节点中有 around-invoke 节点,请问是做什么的?另在配置文件中发现 interceptor 节点中(interceptors)有 around-invoke 节点,请问是做什么的?