/** * Get a constructor Joinpoint * * @param jpf the join point factory * @param paramTypes the parameter types * @param params the parameters * @return the Joinpoint * @throws Throwable for any error */ public static ConstructorJoinpoint getConstructorJoinpoint(JoinpointFactory jpf, String[] paramTypes, Object[] params) throws Throwable { if (paramTypes == null) paramTypes = NO_PARAMS_TYPES; if (params == null) params = NO_PARAMS; boolean trace = log.isTraceEnabled(); if (trace) log.trace("Get constructor Joinpoint jpf=" + jpf + " paramTypes=" + Arrays.asList(paramTypes) + " params=" + Arrays.asList(params)); ConstructorInfo constructorInfo = findConstructorInfo(jpf.getClassInfo(), paramTypes); ConstructorJoinpoint joinpoint = jpf.getConstructorJoinpoint(constructorInfo); joinpoint.setArguments(params); return 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; }
/** * Get a field get joinpoint * * @param object the object to configure * @param jpf the join point factory * @param name the name of the field * @return the Joinpoint * @throws Throwable for any error */ public static FieldGetJoinpoint getFieldGetJoinpoint(Object object, JoinpointFactory jpf, String name) throws Throwable { boolean trace = log.isTraceEnabled(); if (trace) log.trace("Get field get Joinpoint jpf=" + jpf + " target=" + object + " name=" + name); FieldInfo fieldInfo = findFieldInfo(jpf.getClassInfo(), name); FieldGetJoinpoint joinpoint = jpf.getFieldGetJoinpoint(fieldInfo); joinpoint.setTarget(object); return joinpoint; }
/** * Get a field set joinpoint * * @param object the object to configure * @param jpf the join point factory * @param name the name of the field * @param value the value * @return the Joinpoint * @throws Throwable for any error */ public static FieldSetJoinpoint getFieldSetJoinpoint(Object object, JoinpointFactory jpf, String name, Object value) throws Throwable { boolean trace = log.isTraceEnabled(); if (trace) log.trace("Get field set Joinpoint jpf=" + jpf + " target=" + object + " name=" + name + " value=" + value); FieldInfo fieldInfo = findFieldInfo(jpf.getClassInfo(), name); FieldSetJoinpoint joinpoint = jpf.getFieldSetJoinpoint(fieldInfo); joinpoint.setTarget(object); joinpoint.setValue(value); return joinpoint; }
/** * Find a constructor * * @param trace whether trace is enabled * @param info the bean info * @param metaData the constructor metadata * @param object an opaque object * @return the constructor join point * @throws Exception for any error */ public static ConstructorJoinpoint findConstructor(boolean trace, BeanInfo info, ConstructorMetaData metaData, Object object) throws Exception { ConstructorInfo cinfo = resolveConstructor(trace, info, metaData); JoinpointFactory jpf = info.getJoinpointFactory(); if (object == null) return jpf.getConstructorJoinpoint(cinfo); else return jpf.getConstructorJoinpoint(cinfo, object); }
MethodInfo minfo = findMethodInfo(info.getClassInfo(), name, paramTypes, isStatic, isPublic); JoinpointFactory jpf = info.getJoinpointFactory(); MethodJoinpoint joinPoint = jpf.getMethodJoinpoint(minfo);
/** * Get a field set joinpoint * * @param object the object to configure * @param jpf the join point factory * @param name the name of the field * @param value the value * @return the Joinpoint * @throws Throwable for any error */ public static FieldSetJoinpoint getFieldSetJoinpoint(Object object, JoinpointFactory jpf, String name, Object value) throws Throwable { boolean trace = log.isTraceEnabled(); if (trace) log.trace("Get field set Joinpoint jpf=" + jpf + " target=" + object + " name=" + name + " value=" + value); FieldInfo fieldInfo = findFieldInfo(jpf.getClassInfo(), name); FieldSetJoinpoint joinpoint = jpf.getFieldSetJoinpoint(fieldInfo); joinpoint.setTarget(object); joinpoint.setValue(value); return 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; }
/** * Get a constructor Joinpoint * * @param jpf the join point factory * @param paramTypes the parameter types * @param params the parameters * @return the Joinpoint * @throws Throwable for any error */ public static ConstructorJoinpoint getConstructorJoinpoint(JoinpointFactory jpf, String[] paramTypes, Object[] params) throws Throwable { if (paramTypes == null) paramTypes = NO_PARAMS_TYPES; if (params == null) params = NO_PARAMS; boolean trace = log.isTraceEnabled(); if (trace) log.trace("Get constructor Joinpoint jpf=" + jpf + " paramTypes=" + Arrays.asList(paramTypes) + " params=" + Arrays.asList(params)); ConstructorInfo constructorInfo = findConstructorInfo(jpf.getClassInfo(), paramTypes); ConstructorJoinpoint joinpoint = jpf.getConstructorJoinpoint(constructorInfo); joinpoint.setArguments(params); return joinpoint; }
/** * Get a field get joinpoint * * @param object the object to configure * @param jpf the join point factory * @param name the name of the field * @return the Joinpoint * @throws Throwable for any error */ public static FieldGetJoinpoint getFieldGetJoinpoint(Object object, JoinpointFactory jpf, String name) throws Throwable { boolean trace = log.isTraceEnabled(); if (trace) log.trace("Get field get Joinpoint jpf=" + jpf + " target=" + object + " name=" + name); FieldInfo fieldInfo = findFieldInfo(jpf.getClassInfo(), name); FieldGetJoinpoint joinpoint = jpf.getFieldGetJoinpoint(fieldInfo); joinpoint.setTarget(object); return 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; }
/** * 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; }