/** * Invoke a method * * @param object the object to invoke * @param jpf the join point factory * @param name the name of the method * @param paramTypes the parameter types * @param params the parameters * @return the result of the invocation * @throws Throwable for any error */ public static Object invoke(Object object, JoinpointFactory jpf, String name, String[] paramTypes, Object[] params) throws Throwable { MethodJoinpoint joinpoint = getMethodJoinpoint(object, jpf, name, paramTypes, params); return joinpoint.dispatch(); }
/** * Get a method joinpoint * * @param object the object to invoke * @param jpf the join point factory * @param name the name of the method * @param paramTypes the parameter types * @param params the parameters * @return the join point * @throws Throwable for any error */ public static MethodJoinpoint getMethodJoinpoint(Object object, JoinpointFactory jpf, String name, String[] paramTypes, Object[] params) throws Throwable { boolean trace = log.isTraceEnabled(); if (trace) { if (paramTypes != null) log.trace("Get method Joinpoint jpf=" + jpf + " target=" + object + " name=" + name + " paramTypes=" + Arrays.asList(paramTypes)); else log.trace("Get method Joinpoint jpf=" + jpf + " target=" + object + " name=" + name + " paramTypes=()"); } MethodInfo methodInfo = findMethodInfo(jpf.getClassInfo(), name, paramTypes); MethodJoinpoint joinpoint = jpf.getMethodJoinpoint(methodInfo); joinpoint.setTarget(object); joinpoint.setArguments(params); return joinpoint; }
joinPoint.setTarget(factory); MethodInfo minfo = joinPoint.getMethodInfo(); joinPoint.setArguments(params); MethodInfo minfo = joinPoint.getMethodInfo(); joinPoint.setArguments(params);
/** * Get a static method joinpoint * * @param jpf the join point factory * @param name the name of the method * @param paramTypes the parameter types * @param params the parameters * @return the join point * @throws Throwable for any error */ public static MethodJoinpoint getStaticMethodJoinpoint(JoinpointFactory jpf, String name, String[] paramTypes, Object[] params) throws Throwable { boolean trace = log.isTraceEnabled(); if (trace) { if (paramTypes != null) log.trace("Get method Joinpoint jpf=" + jpf + " name=" + name + " paramTypes=" + Arrays.asList(paramTypes)); else log.trace("Get method Joinpoint jpf=" + jpf + " name=" + name + " paramTypes=()"); } MethodInfo methodInfo = findMethodInfo(jpf.getClassInfo(), name, paramTypes, true, true); MethodJoinpoint joinpoint = jpf.getMethodJoinpoint(methodInfo); joinpoint.setArguments(params); return joinpoint; }
joinpoint.setTarget(target); dispatchJoinPoint(context, joinpoint);
/** * Get a static method joinpoint * * @param jpf the join point factory * @param name the name of the method * @param paramTypes the parameter types * @param params the parameters * @return the join point * @throws Throwable for any error */ public static MethodJoinpoint getStaticMethodJoinpoint(JoinpointFactory jpf, String name, String[] paramTypes, Object[] params) throws Throwable { boolean trace = log.isTraceEnabled(); if (trace) { if (paramTypes != null) log.trace("Get method Joinpoint jpf=" + jpf + " name=" + name + " paramTypes=" + Arrays.asList(paramTypes)); else log.trace("Get method Joinpoint jpf=" + jpf + " name=" + name + " paramTypes=()"); } MethodInfo methodInfo = findMethodInfo(jpf.getClassInfo(), name, paramTypes, true, true); MethodJoinpoint joinpoint = jpf.getMethodJoinpoint(methodInfo); joinpoint.setArguments(params); return joinpoint; }
joinpoint.setTarget(target); dispatchJoinPoint(context, joinpoint);
/** * Get a method joinpoint * * @param object the object to invoke * @param jpf the join point factory * @param name the name of the method * @param paramTypes the parameter types * @param params the parameters * @return the join point * @throws Throwable for any error */ public static MethodJoinpoint getMethodJoinpoint(Object object, JoinpointFactory jpf, String name, String[] paramTypes, Object[] params) throws Throwable { boolean trace = log.isTraceEnabled(); if (trace) { if (paramTypes != null) log.trace("Get method Joinpoint jpf=" + jpf + " target=" + object + " name=" + name + " paramTypes=" + Arrays.asList(paramTypes)); else log.trace("Get method Joinpoint jpf=" + jpf + " target=" + object + " name=" + name + " paramTypes=()"); } MethodInfo methodInfo = findMethodInfo(jpf.getClassInfo(), name, paramTypes); MethodJoinpoint joinpoint = jpf.getMethodJoinpoint(methodInfo); joinpoint.setTarget(object); joinpoint.setArguments(params); return joinpoint; }
/** * Invoke a method * * @param object the object to invoke * @param jpf the join point factory * @param name the name of the method * @param paramTypes the parameter types * @param params the parameters * @return the result of the invocation * @throws Throwable for any error */ public static Object invoke(Object object, JoinpointFactory jpf, String name, String[] paramTypes, Object[] params) throws Throwable { MethodJoinpoint joinpoint = getMethodJoinpoint(object, jpf, name, paramTypes, params); return joinpoint.dispatch(); }
joinPoint.setArguments(params);
public Object invokeStatic(String beanName, String[] paramTypes, Object[] params) throws Throwable { MethodJoinpoint joinpoint = Config.getStaticMethodJoinpoint(getJoinpointFactory(), beanName, paramTypes, params); return joinpoint.dispatch(); }
public Object invokeStatic(String name, String[] paramTypes, Object[] params) throws Throwable { MethodJoinpoint joinpoint = Config.getStaticMethodJoinpoint(getJoinpointFactory(), name, paramTypes, params); return joinpoint.dispatch(); }
public Object invoke(Object bean, String beanName, String[] paramTypes, Object[] params) throws Throwable { MethodJoinpoint joinpoint = Config.getMethodJoinpoint(bean, getJoinpointFactory(), beanName, paramTypes, params); return joinpoint.dispatch(); }
public Object invoke(Object bean, String name, String[] paramTypes, Object[] params) throws Throwable { MethodJoinpoint joinpoint = Config.getMethodJoinpoint(bean, getJoinpointFactory(), name, paramTypes, params); return joinpoint.dispatch(); }