public final class MethodProvider
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
FallbackMethod |
getFallbackMethod(java.lang.Class<?> type,
java.lang.reflect.Method commandMethod) |
FallbackMethod |
getFallbackMethod(java.lang.Class<?> enclosingType,
java.lang.reflect.Method commandMethod,
boolean extended)
Gets fallback method for command method.
|
static MethodProvider |
getInstance() |
static com.google.common.base.Optional<java.lang.reflect.Method> |
getMethod(java.lang.Class<?> type,
java.lang.String name,
java.lang.Class<?>... parameterTypes)
Gets method by name and parameters types using reflection,
if the given type doesn't contain required method then continue applying this method for all super classes up to Object class.
|
java.lang.reflect.Method |
unbride(java.lang.reflect.Method bridgeMethod,
java.lang.Class<?> aClass)
Finds generic method for the given bridge method.
|
public static MethodProvider getInstance()
public FallbackMethod getFallbackMethod(java.lang.Class<?> type, java.lang.reflect.Method commandMethod)
public FallbackMethod getFallbackMethod(java.lang.Class<?> enclosingType, java.lang.reflect.Method commandMethod, boolean extended)
enclosingType - the enclosing classcommandMethod - the command method. in the essence it can be a fallback
method annotated with HystrixCommand annotation that has a fallback as well.extended - true if the given commandMethod was derived using additional parameter, otherwise - falseFallbackMethod or FallbackMethod.ABSENT if there is no suitable fallback method for the given commandpublic static com.google.common.base.Optional<java.lang.reflect.Method> getMethod(java.lang.Class<?> type,
java.lang.String name,
java.lang.Class<?>... parameterTypes)
type - the type to search methodname - the method nameparameterTypes - the parameters typespublic java.lang.reflect.Method unbride(java.lang.reflect.Method bridgeMethod,
java.lang.Class<?> aClass)
throws java.io.IOException,
java.lang.NoSuchMethodException,
java.lang.ClassNotFoundException
bridgeMethod - the bridge methodaClass - the type where the bridge method is declaredjava.io.IOExceptionjava.lang.NoSuchMethodExceptionjava.lang.ClassNotFoundException