Annotation Type AroundTimeout
-
@Target(METHOD) @Retention(RUNTIME) public @interface AroundTimeout
Defines an interceptor method that interposes on timeout 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.@AroundTimeout public Object interceptTimeout(InvocationContext ctx) throws Exception { ... }AroundTimeoutmethods 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
AroundTimeoutmethod.An
AroundTimeoutmethod can invoke any component or resource that its corresponding timeout method can invoke.InvocationContext.getTimer()allows anyAroundTimeoutmethod to retrieve the timer object associated with the timeout.In general,
AroundTimeoutmethod invocations occur within the same transaction and security context as the timeout method on which they are interposing.AroundTimeoutmethods may throw any exceptions that are allowed by the throws clause of the timeout method on which they are interposing. They may catch and suppress exceptions and recover by callingInvocationContext.proceed().- Since:
- Jakarta Interceptors 1.1