@Override public Object intercept(MethodProxy handler, Object originalInstance, Object[] args) { System.out.println("authentication start " + handler.method().getName()); Object ret = handler.invoke(originalInstance, args); System.out.println("authentication exit " + handler.method().getName()); return ret; } }
@Override public Object intercept(MethodProxy handler, Object originalInstance, Object[] args) { System.out.println("log entry " + handler.method().getName()); Object ret = handler.invoke(originalInstance, args); System.out.println("log exit " + handler.method().getName()); return ret; } }
Object ret; try { ret = handler.invoke(originalInstance, args); } catch (Exception e) { exception = e;
Object ret; try { ret = handler.invoke(originalInstance, args); } catch (Exception e) { exception = e;
@Override public Object get(Object obj) { return method.invoke(obj); }
@Override public void set(Object obj, Object arg) { method.invoke(obj, arg); }
@SuppressWarnings("unchecked") @Override public <T> T getValue(Object instance) { if (getterMethodProxy != null) { return (T) getterMethodProxy.invoke(instance); } else if (fieldProxy != null) { return (T) fieldProxy.get(instance); } else { return null; } }
@Override public <T> void setValue(Object instance, T value) { if (setterMethodProxy != null) { setterMethodProxy.invoke(instance, value); } else if (fieldProxy != null) { fieldProxy.set(instance, value); } }
@SuppressWarnings("unchecked") @Override public <T> T getValue(Object instance) { if (getterMethodProxy != null) { return (T) getterMethodProxy.invoke(instance); } else if (fieldProxy != null) { return (T) fieldProxy.get(instance); } else { return null; } }
@Override public <T> void setValue(Object instance, T value) { if (setterMethodProxy != null) { setterMethodProxy.invoke(instance, value); } else if (fieldProxy != null) { fieldProxy.set(instance, value); } }