Skip to content

Commit

Permalink
method to call intercepted method
Browse files Browse the repository at this point in the history
  • Loading branch information
n9Mtq4 committed Aug 5, 2015
1 parent 6891504 commit f8a5810
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/com/n9mtq4/reflection/EnhancedProxy.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.n9mtq4.reflection;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

Expand All @@ -21,6 +22,17 @@ public EnhancedProxy(Object obj, EnhancedInvocationHandler handler) {
this.handler = handler;
}

public void callChild(Object obj, Method method, Object[] args) {
try {
method.setAccessible(true);
method.invoke(obj, args);
}catch (InvocationTargetException e) {
e.printStackTrace();
}catch (IllegalAccessException e) {
e.printStackTrace();
}
}

@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

Expand Down

0 comments on commit f8a5810

Please sign in to comment.