The 2nd Early Review Draft for EJB 3 has been released. Apart from changes such as splitting the doc into two (persistence + ‘other’), the main addition is the fact that EJB now has interceptors. Something that people have been wanting for a long time.
Currently the draft states support for Session and Message-Driven Beans, and the spec questions the need for support in Entity bean business methods.
The interceptor module is based on AroundInvoke methods:
public Object methodName(InvocationContext context) throws Exception
The InvocationContext has methods such as:
Good to see something like this making it into the spec. I will be even more excited about EJB 4.0 when it is an aspect based set of concerns ;)
Read more in the EJB 3.0 Docs