/** * Copy the AOP configuration from the given AdvisedSupport object, * but allow substitution of a fresh TargetSource and a given interceptor chain. * @param other the AdvisedSupport object to take proxy configuration from * @param targetSource the new TargetSource * @param advisors the Advisors for the chain */ protected void copyConfigurationFrom(AdvisedSupport other, TargetSource targetSource, List<Advisor> advisors) { copyFrom(other); this.targetSource = targetSource; this.advisorChainFactory = other.advisorChainFactory; this.interfaces = new ArrayList<>(other.interfaces); for (Advisor advisor : advisors) { if (advisor instanceof IntroductionAdvisor) { validateIntroductionAdvisor((IntroductionAdvisor) advisor); } Assert.notNull(advisor, "Advisor must not be null"); this.advisors.add(advisor); } updateAdvisorArray(); adviceChanged(); }
/** * Build a configuration-only copy of this AdvisedSupport, * replacing the TargetSource. */ AdvisedSupport getConfigurationOnlyCopy() { AdvisedSupport copy = new AdvisedSupport(); copy.copyFrom(this); copy.targetSource = EmptyTargetSource.forClass(getTargetClass(), getTargetSource().isStatic()); copy.advisorChainFactory = this.advisorChainFactory; copy.interfaces = this.interfaces; copy.advisors = this.advisors; copy.updateAdvisorArray(); return copy; }
/** * Take interfaces and ProxyConfig configuration from the * other AdvisedSupport, but allow substitution of a fresh * TargetSource and interceptor chain * @param other other AdvisedSupport object to take * interfaces and ProxyConfig superclass configuration from * @param ts new TargetSource * @param pAdvisors new Advisor chain */ protected void copyConfigurationFrom(AdvisedSupport other, TargetSource ts, List pAdvisors) { copyFrom(other); this.targetSource = ts; setInterfaces((Class[]) other.interfaces.toArray(new Class[other.interfaces.size()])); this.advisors = new LinkedList(); for (int i = 0; i < pAdvisors.size(); i++) { Advisor advice = (Advisor) pAdvisors.get(i); addAdvisor(advice); } }
/** * Copy the AOP configuration from the given AdvisedSupport object, * but allow substitution of a fresh TargetSource and a given interceptor chain. * @param other the AdvisedSupport object to take proxy configuration from * @param targetSource the new TargetSource * @param advisors the Advisors for the chain */ protected void copyConfigurationFrom(AdvisedSupport other, TargetSource targetSource, List<Advisor> advisors) { copyFrom(other); this.targetSource = targetSource; this.advisorChainFactory = other.advisorChainFactory; this.interfaces = new ArrayList<Class<?>>(other.interfaces); for (Advisor advisor : advisors) { if (advisor instanceof IntroductionAdvisor) { validateIntroductionAdvisor((IntroductionAdvisor) advisor); } Assert.notNull(advisor, "Advisor must not be null"); this.advisors.add(advisor); } updateAdvisorArray(); adviceChanged(); }
/** * Copy the AOP configuration from the given AdvisedSupport object, * but allow substitution of a fresh TargetSource and a given interceptor chain. * @param other the AdvisedSupport object to take proxy configuration from * @param targetSource the new TargetSource * @param advisors the Advisors for the chain */ protected void copyConfigurationFrom(AdvisedSupport other, TargetSource targetSource, List<Advisor> advisors) { copyFrom(other); this.targetSource = targetSource; this.advisorChainFactory = other.advisorChainFactory; this.interfaces = new ArrayList<>(other.interfaces); for (Advisor advisor : advisors) { if (advisor instanceof IntroductionAdvisor) { validateIntroductionAdvisor((IntroductionAdvisor) advisor); } Assert.notNull(advisor, "Advisor must not be null"); this.advisors.add(advisor); } updateAdvisorArray(); adviceChanged(); }
/** * Build a configuration-only copy of this AdvisedSupport, * replacing the TargetSource. */ AdvisedSupport getConfigurationOnlyCopy() { AdvisedSupport copy = new AdvisedSupport(); copy.copyFrom(this); copy.targetSource = EmptyTargetSource.forClass(getTargetClass(), getTargetSource().isStatic()); copy.advisorChainFactory = this.advisorChainFactory; copy.interfaces = this.interfaces; copy.advisors = this.advisors; copy.updateAdvisorArray(); return copy; }
/** * Build a configuration-only copy of this AdvisedSupport, * replacing the TargetSource. */ AdvisedSupport getConfigurationOnlyCopy() { AdvisedSupport copy = new AdvisedSupport(); copy.copyFrom(this); copy.targetSource = EmptyTargetSource.forClass(getTargetClass(), getTargetSource().isStatic()); copy.advisorChainFactory = this.advisorChainFactory; copy.interfaces = this.interfaces; copy.advisors = this.advisors; copy.updateAdvisorArray(); return copy; }