Package jakarta.interceptor
Annotation Type AroundInvoke
-
@Target(METHOD) @Retention(RUNTIME) public @interface AroundInvoke
Defines an interceptor method that interposes on business methods. The method must take a single parameter of typeInvocationContextand have a return typeObject. The method must not be declared as abstract, final, or static.@AroundInvoke public Object intercept(InvocationContext ctx) throws Exception { ... }AroundInvokemethods may be declared in interceptor classes, in the superclasses of interceptor classes, in the target class, and/or in superclasses of the target class.A given class must not declare more than one
AroundInvokemethod.An
AroundInvokemethod can invoke any component or resource that the method it is intercepting can invoke.In general,
AroundInvokemethod invocations occur within the same transaction and security context as the method on which they are interposing.AroundInvokemethods may throw any exceptions that are allowed by the throws clause of the method on which they are interposing. They may catch and suppress exceptions and recover by callingInvocationContext.proceed().- Since:
- Jakarta Interceptors 1.0