Class DataAccessor.ExceptionSafety
- java.lang.Object
-
- software.amazon.disco.agent.interception.templates.DataAccessor.ExceptionSafety
-
- Enclosing class:
- DataAccessor
public static class DataAccessor.ExceptionSafety extends java.lang.ObjectAn Advice class to wrap generated methods in catch-all exception safety. Should any exception occur, such as a NullPointerException from unchecked method chaining, it will be silently suppressed, and the return value of the access method will be the default value for the return type i.e. 0 for primitive numbers, and null for reference types.
-
-
Constructor Summary
Constructors Constructor Description ExceptionSafety()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidonMethodExit(java.lang.Throwable thrown)Advice on method exit, to rewrite any thrown exception to be null, and therefore suppressed
-
-
-
Method Detail
-
onMethodExit
@OnMethodExit(onThrowable=java.lang.Throwable.class) public static void onMethodExit(@Thrown(readOnly=false) java.lang.Throwable thrown)Advice on method exit, to rewrite any thrown exception to be null, and therefore suppressed- Parameters:
thrown- the exception which was thrown, which will be suppressed
-
-