public <T extends Annotation> T resolveAnnotation(Class<T> annotation) { T val = super.resolveAnnotation(annotation); if (val != null) return val; if (getAdvisor() != null) { val = getAdvisor().resolveTypedAnnotation(advisedField, annotation); if (val != null) return val; } return null; }
public <T extends Annotation> T resolveAnnotation(Class<T> annotation) { T val = super.resolveAnnotation(annotation); if (val != null) return val; if (getAdvisor() != null) { val = getAdvisor().resolveTypedAnnotation(constructor, annotation); if (val != null) return val; } return null; }
public <T extends Annotation> T resolveAnnotation(Class<T> annotation) { T val = super.resolveAnnotation(annotation); if (val != null) return val; if (getAdvisor() != null) { val = getAdvisor().resolveTypedAnnotation(constructor, annotation); if (val != null) return val; } return null; } }
public void initializeMetadata() { createMethodMap(); createConstructorTables(); createFieldTable(); getManager().attachMetaData(this, clazz); rebindClassMetaData(); deployAnnotationOverrides(); }
public CallerMethodInfo(Advisor advisor, Class<?> calledClass, Method m, long calledMethodHash, Interceptor[] in, Class<?> clazz) { super(advisor, clazz); this.calledClass = calledClass; super.setInterceptors(in); this.method = m; this.calledMethodHash = calledMethodHash; this.callingClass = advisor.getClazz(); }
public Object invokeMethod(Object target, long methodHash, Object[] arguments) throws Throwable { InstanceAdvisor advisor = null; if (target != null) { InstanceAdvised advised = (InstanceAdvised) target; advisor = advised._getInstanceAdvisor(); } MethodInfo info = methodInfos.getMethodInfo(methodHash); return invokeMethod(advisor, target, methodHash, arguments, info); }
public MethodByConInfo(Advisor advisor, Class<?> calledClass, Class<?> callingClass, int callingIndex, Method m, long calledMethodHash, Interceptor[] in) { super(advisor, calledClass, m, calledMethodHash, in, callingClass); this.callingIndex = callingIndex; Advisor tempAdvisor = advisor; if (advisor.getClazz() != callingClass) { tempAdvisor = advisor.manager.getAdvisor(callingClass); } calling = tempAdvisor.constructors[callingIndex]; }
public void undeployAspectMethodBinding(AspectAnnotationLoader loader, String bindingName, String className, String methodName) { String adviceName = className + "." + methodName; loader.getAspectManager().removeInterceptorFactory(adviceName); loader.getAspectManager().removePointcut(bindingName); loader.getAspectManager().removeBinding(bindingName); }
/** * Added to notify interceptor chain observer of interceptor chain garbage collection. */ protected void finalize() { ClassLoader classLoader = delegate.getAdvisor().getClassLoader(); if (this.interceptorChainObserver == null || !AspectManager.getRegisteredCLs().containsKey(classLoader)) { return; } this.interceptorChainObserver.allInstanceInterceptorsRemoved(this); }
/** * Notification method. * @see InterceptorChainObserver#instanceInterceptorsAdded(InstanceAdvisor, int) */ public synchronized void instanceInterceptorsAdded(InstanceAdvisor instanceAdvisor, int howMany) { updateInstanceInterceptorsTable(instanceAdvisor, howMany); updateAdvisenessStatus(this.newlyAdvised); this.instanceInterceptors += howMany; HotSwapStrategy.this.interceptorChainsUpdated(); }
public void undeployInterceptor(AspectAnnotationLoader loader, String name) { undeployAspect(loader, name); loader.getAspectManager().removeInterceptorFactory(name); }
/** * Called back from generated code */ public Object createAndRebindJoinPointForInstance(JoinPointInfo info) { JoinPointInfo newinfo = info.copy(); newinfo.setAdvisor(this); return rebindJoinPointWithInstanceInformation(newinfo); }
public static void undeployXML(URL url, AspectManager manager) throws Exception { XmlLoader loader = null; if (factory == null) { loader = new AspectXmlLoader(); } else { loader = factory.create(); } loader.undeploy(url, manager); }
public void finalizeConstructorChain(ConstructorInfo[] newConstructorInfos) { for (int i = 0; i < newConstructorInfos.length; i++) { ConstructorInfo info = newConstructorInfos[i]; ConstructorJoinPointGenerator generator = getJoinPointGenerator(info); Class<?> clazz = info.getClazz(); if (clazz != null) finalizeChainAndRebindJoinPoint(oldInfos, info, generator, OldInfoMaps.INFOS); } }
/** * This will not remove interceptor pointcuts! You will have to do this through AspectManager */ public void removeInterceptor(String name) { int interceptorsRemoved = internalRemoveInterceptor(name); if (interceptorChainObserver != null) { interceptorChainObserver.instanceInterceptorsRemoved(this, interceptorsRemoved); } }
public void undeployDeclare(Element pointcut) throws Exception { String name = getName(pointcut, "declare"); manager.removeDeclare(name); }
public void deployClassMetaData(Element element) throws Exception { ClassMetaDataBinding data = loadMetaData(element); manager.addClassMetaData(data); }
public MethodInfo getMethodInfo(long hash) { MethodMatchInfo info = getMatchInfo(hash); if (info != null) { return info.getInfo(); } return null; }
public CallerConstructorInfo(Advisor advisor, Class<?> calledClass, Constructor<?> called, long calledConHash, Method wrappingMethod, Interceptor[] in, Class<?> clazz) { super(advisor, clazz); this.calledClass = calledClass; super.setInterceptors(in); this.constructor = called; this.calledConHash = calledConHash; this.callingClass = advisor.getClazz(); this.wrappingMethod = wrappingMethod; }
/** * Notification method. * @see InterceptorChainObserver#instanceInterceptorsRemoved(InstanceAdvisor, int) */ public synchronized void instanceInterceptorsRemoved(InstanceAdvisor instanceAdvisor, int howMany) { updateInstanceInterceptorsTable(instanceAdvisor, -howMany); this.instanceInterceptors -= howMany; updateAdvisenessStatus(this.newlyUnadvised); HotSwapStrategy.this.interceptorChainsUpdated(); }