Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdi-dev] Bean/interceptor clarification question

Actually I'm not following the terminology correctly in my previous email. I meant:

A target class may declare an interceptor method, but that doesn't make the target class an interceptor class.

But the distinction between an interceptor and an interceptor class is usually obvious from the context, so that shouldn't be a problem I hope :-)

LT

On Tue, Oct 3, 2023 at 8:53 AM Ladislav Thon <lthon@xxxxxxxxxx> wrote:
The terminology around interceptors may sometimes be a little fuzzy, due to the existence of a separate Interceptors specification, but if you follow the terminology definitions there https://jakarta.ee/specifications/interceptors/2.0/interceptors-spec-2.0.html#terminology, the answer is _no_. A target class may declare an interceptor method, but that doesn't make the target class an interceptor.

LT

On Mon, Oct 2, 2023 at 10:05 PM Laird Nelson via cdi-dev <cdi-dev@xxxxxxxxxxx> wrote:
Is a bean class with an @AroundInvoke method an interceptor class (in CDI Full of course)?

For example:

// Assume Bean is discovered or added programmatically, i.e. it is a valid CDI bean.
// Is it also an interceptor?
public class Bean {
  public void businessMethod() {
    // do something
  }
  Object aroundInvokeMethod(InvocationContext ic) throws Exception {
    return ic.proceed();
  }
}

Best,
Laird

_______________________________________________
cdi-dev mailing list
cdi-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/cdi-dev

Back to the top