public abstract class AbstractAdapterHandler
extends java.lang.Object
implements java.lang.reflect.InvocationHandler
Modifier and Type | Field and Description |
---|---|
protected AdapterExceptionHandler |
handler |
protected boolean |
isBindingMethod |
protected Processor |
serviceAdapter |
protected java.lang.Object |
subjectService |
Constructor and Description |
---|
AbstractAdapterHandler(Processor serviceAdapter,
java.lang.Object subjectService)
TODO Describe this method
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object[] |
adaptArguments(java.lang.reflect.Method subjectMethod,
java.lang.Object[] args)
TODO Describe this method
|
protected java.lang.Object |
adaptReturnType(java.lang.Object object,
java.lang.reflect.Method method)
TODO Describe this method
|
protected java.lang.reflect.Method |
considerMethodAnnotations(java.lang.reflect.Method method,
java.lang.Object[] args)
TODO Describe this method
|
protected java.lang.reflect.Method |
getAdaptedMethod(java.lang.reflect.Method method)
TODO Describe this method
|
protected java.lang.reflect.Field[] |
getAllFields(java.lang.Object object)
TODO Describe this method
|
protected java.lang.Class[] |
getAllInterfaces(java.lang.Object object)
TODO Describe this method
|
protected static AuditActions |
getAuditAction(java.lang.reflect.Method method)
TODO Describe this method
|
protected java.lang.Class |
getComponentType()
TODO Describe this method
|
protected java.lang.reflect.Method |
getDeclaredMatchingMethod(java.lang.Class[] interfaces,
java.lang.reflect.Method method)
TODO Describe this method
|
protected java.lang.reflect.Method |
getDeclaredMatchingMethod(java.lang.Class clazz,
java.lang.reflect.Method method)
TODO Describe this method
|
protected java.lang.reflect.Method |
getDeclaredMatchingMethod(java.lang.Object object,
java.lang.reflect.Method method)
TODO Describe this method
|
protected java.lang.Object |
getFieldValue(java.lang.Object object,
java.lang.String fieldName)
TODO Describe this method
|
protected java.lang.Class |
getInterface(java.lang.Object object,
java.lang.String interfaceName)
TODO Describe this method
|
protected java.util.Iterator |
getIterator(java.lang.Object object,
java.lang.reflect.Method method) |
protected java.lang.reflect.Method |
getMatchingMethod(java.lang.Object object,
java.lang.reflect.Method method)
Deprecated.
|
protected java.lang.reflect.Method |
getMatchingMethod(java.lang.Object object,
java.lang.String methodName)
Deprecated.
|
protected java.lang.Class |
getReturnParameterizedType(java.lang.reflect.Method method) |
protected java.lang.String |
getterMethod(java.lang.String fieldName)
TODO Describe this method
|
protected java.lang.Object |
handleArray(java.lang.Object object,
java.lang.reflect.Method method)
TODO Describe this method
|
protected java.lang.Object |
handleCollection(java.lang.Object object,
java.lang.reflect.Method method)
TODO Describe this method
|
protected abstract java.lang.Object |
handleServiceInvocation(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
TODO Describe this method
|
protected java.lang.Object |
hookBeforeInvocation(java.lang.Object object,
java.lang.reflect.Method method,
java.lang.Object[] args)
TODO Describe this method
|
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args) |
protected java.lang.Object |
invokeMethod(java.lang.Object obj,
java.lang.reflect.Method method,
java.lang.Object[] args)
TODO Describe this method
|
protected java.lang.Object |
invokeMethod(java.lang.Object obj,
java.lang.reflect.Method method,
java.lang.Object[] args,
boolean isMatching)
TODO Describe this method
|
protected java.lang.Object |
invokeMethodOnServiceAdapter(java.lang.reflect.Method method,
java.lang.Object[] args)
TODO Describe this method
|
protected java.lang.Object |
invokeMethodOnSubjectService(java.lang.reflect.Method method,
java.lang.Object[] args)
TODO Describe this method
|
protected abstract boolean |
isAdaptArgumentType(java.lang.reflect.Method method,
java.lang.Object[] args)
TODO Describe this method
|
protected abstract boolean |
isAdaptReturnType(java.lang.reflect.Method method,
java.lang.Object[] args)
TODO Describe this method
|
protected boolean |
isAnnotated(java.lang.reflect.Method method)
TODO Describe this method
|
protected boolean |
isArray(java.lang.Object object)
TODO Describe this method
|
protected boolean |
isCollection(java.lang.Object object)
TODO Describe this method
|
protected boolean |
isCompatibleType(java.lang.Object object,
java.lang.reflect.Method method)
Checks if the object passed is compatible to method return type
|
protected boolean |
isDeclared(java.lang.reflect.Method method,
java.lang.Class[] interfaces)
TODO Describe this method
|
protected boolean |
isHandleByAdapter(java.lang.reflect.Method method)
TODO Describe this method
|
protected boolean |
isProxy(java.lang.Object object)
TODO Describe this method
|
protected boolean |
isSimilar(java.lang.reflect.Method m1,
java.lang.reflect.Method m2)
Checks if two methods passed have similar name,this might extend
in future
|
protected java.lang.Class |
loadClass(java.lang.String className) |
static void |
printFields(java.lang.Class cl) |
protected void |
printFields(java.lang.Object object) |
protected void |
printInterfaceNames(java.lang.Object o) |
protected java.lang.String |
printMethodInfo(java.lang.reflect.Method method)
TODO Describe this method
|
protected void |
printMethods(java.lang.Object object) |
protected void |
printParameterizedTypeInfo(java.lang.reflect.ParameterizedType paramType) |
protected java.lang.Object |
proxyIt(java.lang.Object object,
java.lang.Class componentType) |
protected java.lang.Object |
proxyIt(java.lang.Object object,
java.lang.reflect.Method method)
TODO Describe this method
|
protected java.lang.String |
setterMethod(java.lang.String fieldName)
TODO Describe this method
|
protected java.lang.Object |
unProxy(java.lang.Object proxy)
TODO Describe this method
|
protected Processor serviceAdapter
protected java.lang.Object subjectService
protected boolean isBindingMethod
protected AdapterExceptionHandler handler
public AbstractAdapterHandler(Processor serviceAdapter, java.lang.Object subjectService)
serviceAdapter
- subjectService
- public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
invoke
in interface java.lang.reflect.InvocationHandler
java.lang.Throwable
protected abstract java.lang.Object handleServiceInvocation(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
proxy
- method
- args
- java.lang.Throwable
protected abstract boolean isAdaptReturnType(java.lang.reflect.Method method, java.lang.Object[] args)
method
- args
- protected abstract boolean isAdaptArgumentType(java.lang.reflect.Method method, java.lang.Object[] args)
method
- args
- protected java.lang.Class getComponentType()
protected java.lang.Object invokeMethodOnSubjectService(java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
method
- args
- java.lang.Throwable
protected java.lang.Object invokeMethodOnServiceAdapter(java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
method
- args
- java.lang.Throwable
protected boolean isHandleByAdapter(java.lang.reflect.Method method)
method
- java.lang.Throwable
protected java.lang.Object hookBeforeInvocation(java.lang.Object object, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
object
- method
- java.lang.Throwable
protected java.lang.Object adaptReturnType(java.lang.Object object, java.lang.reflect.Method method)
object
- method
- protected java.lang.Object proxyIt(java.lang.Object object, java.lang.reflect.Method method)
object
- method
- protected java.lang.Object proxyIt(java.lang.Object object, java.lang.Class componentType)
protected boolean isCompatibleType(java.lang.Object object, java.lang.reflect.Method method)
object
- method
- protected boolean isSimilar(java.lang.reflect.Method m1, java.lang.reflect.Method m2)
m1
- m2
- protected java.lang.reflect.Method getDeclaredMatchingMethod(java.lang.Object object, java.lang.reflect.Method method)
object
- method
- protected java.lang.reflect.Method getDeclaredMatchingMethod(java.lang.Class[] interfaces, java.lang.reflect.Method method)
interfaces
- method
- protected java.lang.reflect.Method getDeclaredMatchingMethod(java.lang.Class clazz, java.lang.reflect.Method method)
clazz
- method
- @Deprecated protected java.lang.reflect.Method getMatchingMethod(java.lang.Object object, java.lang.reflect.Method method)
object
- method
- @Deprecated protected java.lang.reflect.Method getMatchingMethod(java.lang.Object object, java.lang.String methodName)
object
- methodName
- protected java.lang.Object[] adaptArguments(java.lang.reflect.Method subjectMethod, java.lang.Object[] args)
subjectMethod
- args
- protected java.lang.reflect.Field[] getAllFields(java.lang.Object object)
object
- protected java.lang.Object getFieldValue(java.lang.Object object, java.lang.String fieldName)
object
- fieldName
- protected boolean isProxy(java.lang.Object object)
object
- protected java.lang.Object unProxy(java.lang.Object proxy)
proxy
- public static void printFields(java.lang.Class cl)
protected boolean isArray(java.lang.Object object)
object
- protected java.lang.Class[] getAllInterfaces(java.lang.Object object)
object
- protected boolean isCollection(java.lang.Object object)
object
- protected java.lang.Class getInterface(java.lang.Object object, java.lang.String interfaceName)
object
- interfaceName
- protected java.lang.Object handleCollection(java.lang.Object object, java.lang.reflect.Method method)
object
- method
- protected java.util.Iterator getIterator(java.lang.Object object, java.lang.reflect.Method method) throws java.lang.Throwable
java.lang.Throwable
protected java.lang.Object handleArray(java.lang.Object object, java.lang.reflect.Method method)
object
- method
- protected java.lang.Class getReturnParameterizedType(java.lang.reflect.Method method)
protected java.lang.Class loadClass(java.lang.String className) throws java.lang.Exception
java.lang.Exception
protected java.lang.String getterMethod(java.lang.String fieldName)
fieldName
- protected java.lang.String setterMethod(java.lang.String fieldName)
fieldName
- protected java.lang.String printMethodInfo(java.lang.reflect.Method method)
method
- protected void printInterfaceNames(java.lang.Object o)
protected void printMethods(java.lang.Object object)
protected void printFields(java.lang.Object object)
protected void printParameterizedTypeInfo(java.lang.reflect.ParameterizedType paramType)
protected java.lang.Object invokeMethod(java.lang.Object obj, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
obj
- method
- args
- java.lang.Throwable
protected java.lang.Object invokeMethod(java.lang.Object obj, java.lang.reflect.Method method, java.lang.Object[] args, boolean isMatching) throws java.lang.Throwable
obj
- method
- args
- java.lang.Throwable
protected boolean isDeclared(java.lang.reflect.Method method, java.lang.Class[] interfaces)
method
- interfaces
- protected java.lang.reflect.Method considerMethodAnnotations(java.lang.reflect.Method method, java.lang.Object[] args)
method
- args
- protected boolean isAnnotated(java.lang.reflect.Method method)
method
- protected java.lang.reflect.Method getAdaptedMethod(java.lang.reflect.Method method)
method
- protected static AuditActions getAuditAction(java.lang.reflect.Method method)
method
- Copyright © 2017 Cloud Software Group, Inc. All Rights Reserved.