Class ApiFindInterceptor
java.lang.Object
com.bld.proxy.api.find.intecerptor.ApiFindInterceptor
- All Implemented Interfaces:
InvocationHandler
JDK
InvocationHandler that serves as the entry point for every
proxied controller method call in the proxy-api-controller framework.
This component is set as the InvocationHandler for
every dynamic proxy registered by ApiFindRegistrar.
On each method invocation it retrieves a prototype-scoped FindInterceptor
bean from the Spring context (ensuring thread-safety and request isolation) and
delegates the actual query execution to it.
The hashCode method is short-circuited and returns 0 to avoid
infinite proxy recursion when the bean is stored in hash-based collections.
- Author:
- Francesco Baldi
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ApiFindInterceptor
public ApiFindInterceptor()
-
-
Method Details
-
invoke
Intercepts every method call on a proxied@ApiFindControllerinterface.Retrieves a fresh prototype
FindInterceptorbean for each invocation and delegates toFindInterceptor.find(Object, Method, Object[]).- Specified by:
invokein interfaceInvocationHandler- Parameters:
obj- the proxy instancemethod- the interface method that was invokedargs- the runtime arguments supplied to the method call- Returns:
- the query result produced by the
FindInterceptor - Throws:
Throwable- if the underlying query or mapping fails
-