- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A fallback or recovery method used with Aspects.
This isn't strictly required but more a helper to make it easier for aspects that want to use a fallback or recovery method.
-
Method Summary
-
Method Details
-
find
Find and return the fallback given the name and original method.This will first try and find the method for the name that has the same parameters as the method but additionally takes a
Throwable
as the last parameter. If no matching method is found it then looks for the method with the name that just has the matching parameters (and not the additional throwable).- Parameters:
name
- The name of the fallback methodmethod
- The original method which we match to using argument types.- Returns:
- The fallback
- Throws:
NoSuchMethodException
- When no matching fallback method is found
-
invoke
Invoke the fallback method given the invocation and exception.- Parameters:
call
- The invocation being executedsourceException
- The exception thrown that triggers the use of the fallback method
-