Annotation Interface AroundTimeout


@Target(METHOD) @Retention(RUNTIME) public @interface AroundTimeout

Defines an interceptor method that interposes on timeout methods. May be applied to any non-final, non-static method with a single parameter of type InvocationContext and return type Object of the target class (or superclass) or of any interceptor class.

 @AroundTimeout
 public Object interceptTimeout(InvocationContext ctx) throws Exception { ... }
 

A class must not declare more than one AroundTimeout method.

An AroundTimeout method can invoke any component or resource that its corresponding timeout method can invoke.

InvocationContext.getTimer() allows any AroundTimeout method to retrieve the timer object associated with the timeout.

AroundTimeout method invocations occur within the same transaction and security context as the timeout method on which they are interposing.

AroundTimeout methods 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 calling InvocationContext.proceed().

Since:
Interceptors 1.1