java.lang.Object
org.tentackle.reflect.InterceptionUtilities
Utility methods for interception handling.
- Author:
- harald
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateInterceptableMethod
(Class<? extends Interceptable> clazz, Class<? extends Interceptable> delegateClazz, Method method) Creates an interceptable method.findDeclaredMethod
(Class<?> clazz, Method method) Finds the declared interface method for a given method signature.
This usually indicates that the invocation handler is not servicing the expected interface.
The default implementation just logs the fact that something is weird and returns the passed method.findInterceptors
(Class<?> clazz, Method method, Method implMethod) Finds all interceptors of a method.static InterceptionUtilities
The singleton.
-
Constructor Details
-
InterceptionUtilities
public InterceptionUtilities()Creates the interception utilities.
-
-
Method Details
-
getInstance
The singleton.- Returns:
- the singleton
-
findInterceptors
Finds all interceptors of a method.- Parameters:
clazz
- the interface which the interface the method is declared in extendsmethod
- the interface methodimplMethod
- the implementing class method- Returns:
- the head of interceptors, null if not intercepted
-
createInterceptableMethod
public InterceptableMethod createInterceptableMethod(Class<? extends Interceptable> clazz, Class<? extends Interceptable> delegateClazz, Method method) Creates an interceptable method.Finds the implementing method of the delegate and optional interceptors.
- Parameters:
clazz
- the topmost interceptable interfacedelegateClazz
- the delegate's class to invoke the method onmethod
- the interface's method to invoke- Returns:
- the interceptable method
-
findDeclaredMethod
Finds the declared interface method for a given method signature.
This usually indicates that the invocation handler is not servicing the expected interface.
The default implementation just logs the fact that something is weird and returns the passed method.- Parameters:
clazz
- the top-level interface serviced by the invocation handlermethod
- the invoked interface method- Returns:
- the effective interface method to scan for public interceptors
-