public MethodInfo[] getMethodInfos() { Object[] vals = methodInfos.getValues(); MethodInfo[] infos = new MethodInfo[vals.length]; System.arraycopy(vals, 0, infos, 0, vals.length); return infos; }
protected void unlockWriteChain(MethodInterceptors methodInterceptors) { Object[] methodMatchInfos = methodInterceptors.infos.getValues(); for (int i = 0; i < methodMatchInfos.length; i++) { MethodMatchInfo methodMatchInfo = (MethodMatchInfo) methodMatchInfos[i]; methodMatchInfo.getInfo().getInterceptorChainReadWriteLock().writeLock().unlock(); } }
protected void lockWriteChain(MethodInterceptors methodInterceptors) { Object[] methodMatchInfos = methodInterceptors.infos.getValues(); for (int i = 0; i < methodMatchInfos.length; i++) { MethodMatchInfo methodMatchInfo = (MethodMatchInfo) methodMatchInfos[i]; methodMatchInfo.getInfo().getInterceptorChainReadWriteLock().writeLock().lock(); } }
protected void bindClassMetaData(ClassMetaDataBinding data) { try { ClassMetaDataLoader loader = data.getLoader(); Object[] objs = advisedMethods.getValues(); Method[] methods = new Method[objs.length]; for (int i = 0; i < objs.length; i++) methods[i] = (Method) objs[i]; loader.bind(this, data, methods, advisedFields, clazz.getDeclaredConstructors()); } catch (Exception ex) { // REVISIT: Need to know how errors affects deployment ex.printStackTrace(); } }
protected void resetChainKeepInterceptors(MethodInterceptors methodInterceptors) { Object[] methodMatchInfos = methodInterceptors.infos.getValues(); for (int i = 0; i < methodMatchInfos.length; i++) { MethodMatchInfo methodMatchInfo = (MethodMatchInfo) methodMatchInfos[i]; JoinPointInfo info = methodMatchInfo.getInfo(); info.clear(); } }
protected void resetChain(MethodInterceptors methodInterceptors) { Object[] methodMatchInfos = methodInterceptors.infos.getValues(); for (int i = 0; i < methodMatchInfos.length; i++) { MethodMatchInfo methodMatchInfo = (MethodMatchInfo) methodMatchInfos[i]; if (methodMatchInfo.bindings != null) { methodMatchInfo.bindings.clear(); } if (methodMatchInfo.pointcutMethodMatches != null) { methodMatchInfo.pointcutMethodMatches.clear(); } methodMatchInfo.getInfo().clear(); } }
protected void bindClassMetaData(ClassMetaDataBinding data) { try { ClassMetaDataLoader loader = data.getLoader(); Object[] objs = advisedMethods.getValues(); Method[] methods = new Method[objs.length]; Field[] fields = advisedFields; // set to empty array because advisedFields may not have been initialized yet if (fields == null) fields = new Field[0]; Constructor<?>[] cons = constructors; // set to empty array because constructors may not have been initialized yet if (cons == null) cons = new Constructor[0]; for (int i = 0; i < objs.length; i++) methods[i] = (Method) objs[i]; loader.bind(this, data, methods, fields, cons); } catch (Exception ex) { // REVISIT: Need to know how errors affects deployment ex.printStackTrace(); } }
Object[] methods = advisor.getAdvisedMethods().getValues();
protected void bindMethodAdvices(Class<?> superClass, ClassifiedBindingAndPointcutCollection bindingCol) { createMethodMap(superClass); if (methodMap != null) { Collection<AdviceBinding> bindings = bindingCol.getMethodExecutionBindings(); Object[] methods = methodMap.getValues(); for (int i = 0 ; i < methods.length ; i++) { bindMethodAdvice((Method)methods[i], bindings); } } }
private Method[] interceptGetDeclaredMethods(Class<?> clazz) { ClassAdvisor advisor = AspectManager.instance().getAdvisorIfAdvised(clazz); if (advisor == null) { return getDeclaredMethods(clazz); } else { Object[] advisedMethods = advisor.getAdvisedMethods().getValues(); ArrayList<Method> methods = new ArrayList<Method>(advisedMethods.length); for (int i = 0; i < advisedMethods.length; i++) { Method m = (Method) advisedMethods[i]; if (clazz.equals(m.getDeclaringClass()) && ReflectUtils.isNotAccessMethod(m) && isNotJavassistWrappedMethod(m)) { methods.add(m); } } return methods.toArray(new Method[methods.size()]); } }
foundMethods = advisor.getAdvisedMethods().getValues();
Object[] values = map.getValues(); for (int i = 0; i < values.length; i++)
Object[] values = map.getValues(); for (int i = 0; i < values.length; i++)
private Method interceptGetDeclaredMethod(Class<?> clazz, Object[] args) throws NoSuchMethodException { ClassAdvisor advisor = AspectManager.instance().getAdvisorIfAdvised(clazz); Method method = getDeclaredMethod(clazz, (String) args[0], (Class[]) args[1]); if (advisor == null) { return method; } else { Object[] advisedMethods = advisor.getAdvisedMethods().getValues(); for (int i = 0; i < advisedMethods.length; i++) { Method m = (Method) advisedMethods[i]; if (m.equals(method) && ReflectUtils.isNotAccessMethod(m) && isNotJavassistWrappedMethod(m)) { return method; } } } throw new NoSuchMethodException(); }