/** * Check equality of the advisors behind the given AdvisedSupport objects. */ public static boolean equalsAdvisors(AdvisedSupport a, AdvisedSupport b) { return Arrays.equals(a.getAdvisors(), b.getAdvisors()); }
/** * Construct a new JdkDynamicAopProxy for the given AOP configuration. * @param config the AOP configuration as AdvisedSupport object * @throws AopConfigException if the config is invalid. We try to throw an informative * exception in this case, rather than let a mysterious failure happen later. */ public JdkDynamicAopProxy(AdvisedSupport config) throws AopConfigException { Assert.notNull(config, "AdvisedSupport must not be null"); if (config.getAdvisors().length == 0 && config.getTargetSource() == AdvisedSupport.EMPTY_TARGET_SOURCE) { throw new AopConfigException("No advisors and no TargetSource specified"); } this.advised = config; }
/** * Create a new CglibAopProxy for the given AOP configuration. * @param config the AOP configuration as AdvisedSupport object * @throws AopConfigException if the config is invalid. We try to throw an informative * exception in this case, rather than let a mysterious failure happen later. */ public CglibAopProxy(AdvisedSupport config) throws AopConfigException { Assert.notNull(config, "AdvisedSupport must not be null"); if (config.getAdvisors().length == 0 && config.getTargetSource() == AdvisedSupport.EMPTY_TARGET_SOURCE) { throw new AopConfigException("No advisors and no TargetSource specified"); } this.advised = config; this.advisedDispatcher = new AdvisedDispatcher(this.advised); }
@Override public int hashCode() { int hashCode = 0; Advisor[] advisors = this.advised.getAdvisors(); for (Advisor advisor : advisors) { Advice advice = advisor.getAdvice(); hashCode = 13 * hashCode + advice.getClass().hashCode(); } hashCode = 13 * hashCode + (this.advised.isFrozen() ? 1 : 0); hashCode = 13 * hashCode + (this.advised.isExposeProxy() ? 1 : 0); hashCode = 13 * hashCode + (this.advised.isOptimize() ? 1 : 0); hashCode = 13 * hashCode + (this.advised.isOpaque() ? 1 : 0); return hashCode; } }
Advisor[] thisAdvisors = this.advised.getAdvisors(); Advisor[] thatAdvisors = otherAdvised.getAdvisors(); if (thisAdvisors.length != thatAdvisors.length) { return false;
/** * Check equality of the advisors behind the given AdvisedSupport objects. */ public static boolean equalsAdvisors(AdvisedSupport a, AdvisedSupport b) { return Arrays.equals(a.getAdvisors(), b.getAdvisors()); }
/** * Check equality of the advisors behind the given AdvisedSupport objects. */ public static boolean equalsAdvisors(AdvisedSupport a, AdvisedSupport b) { return Arrays.equals(a.getAdvisors(), b.getAdvisors()); }
/** * Check equality of the advisors behind the given AdvisedSupport objects. */ public static boolean equalsAdvisors(AdvisedSupport a, AdvisedSupport b) { return Arrays.equals(a.getAdvisors(), b.getAdvisors()); }
/** * Construct a new JdkDynamicAopProxy for the given AOP configuration. * @param config the AOP configuration as AdvisedSupport object * @throws AopConfigException if the config is invalid. We try to throw an informative * exception in this case, rather than let a mysterious failure happen later. */ public JdkDynamicAopProxy(AdvisedSupport config) throws AopConfigException { Assert.notNull(config, "AdvisedSupport must not be null"); if (config.getAdvisors().length == 0 && config.getTargetSource() == AdvisedSupport.EMPTY_TARGET_SOURCE) { throw new AopConfigException("No advisors and no TargetSource specified"); } this.advised = config; }
/** * Construct a new JdkDynamicAopProxy for the given AOP configuration. * @param config the AOP configuration as AdvisedSupport object * @throws AopConfigException if the config is invalid. We try to throw an informative * exception in this case, rather than let a mysterious failure happen later. */ public JdkDynamicAopProxy(AdvisedSupport config) throws AopConfigException { Assert.notNull(config, "AdvisedSupport must not be null"); if (config.getAdvisors().length == 0 && config.getTargetSource() == AdvisedSupport.EMPTY_TARGET_SOURCE) { throw new AopConfigException("No advisors and no TargetSource specified"); } this.advised = config; }
/** * Create a new CglibAopProxy for the given AOP configuration. * @param config the AOP configuration as AdvisedSupport object * @throws AopConfigException if the config is invalid. We try to throw an informative * exception in this case, rather than let a mysterious failure happen later. */ public CglibAopProxy(AdvisedSupport config) throws AopConfigException { Assert.notNull(config, "AdvisedSupport must not be null"); if (config.getAdvisors().length == 0 && config.getTargetSource() == AdvisedSupport.EMPTY_TARGET_SOURCE) { throw new AopConfigException("No advisors and no TargetSource specified"); } this.advised = config; this.advisedDispatcher = new AdvisedDispatcher(this.advised); }
/** * Create a new CglibAopProxy for the given AOP configuration. * @param config the AOP configuration as AdvisedSupport object * @throws AopConfigException if the config is invalid. We try to throw an informative * exception in this case, rather than let a mysterious failure happen later. */ public CglibAopProxy(AdvisedSupport config) throws AopConfigException { Assert.notNull(config, "AdvisedSupport must not be null"); if (config.getAdvisors().length == 0 && config.getTargetSource() == AdvisedSupport.EMPTY_TARGET_SOURCE) { throw new AopConfigException("No advisors and no TargetSource specified"); } this.advised = config; this.advisedDispatcher = new AdvisedDispatcher(this.advised); }
/** * Construct a new JDK proxy. * @throws AopConfigException if the config is invalid. We try * to throw an informative exception in this case, rather than let * a mysterious failure happen later. */ protected JdkDynamicAopProxy(AdvisedSupport config) throws AopConfigException { if (config == null) { throw new AopConfigException("Cannot create AopProxy with null ProxyConfig"); } if (config.getAdvisors().length == 0 && config.getTargetSource() == AdvisedSupport.EMPTY_TARGET_SOURCE) { throw new AopConfigException("Cannot create AopProxy with no advisors and no target source"); } this.advised = config; }
@Override public int hashCode() { int hashCode = 0; Advisor[] advisors = this.advised.getAdvisors(); for (Advisor advisor : advisors) { Advice advice = advisor.getAdvice(); hashCode = 13 * hashCode + advice.getClass().hashCode(); } hashCode = 13 * hashCode + (this.advised.isFrozen() ? 1 : 0); hashCode = 13 * hashCode + (this.advised.isExposeProxy() ? 1 : 0); hashCode = 13 * hashCode + (this.advised.isOptimize() ? 1 : 0); hashCode = 13 * hashCode + (this.advised.isOpaque() ? 1 : 0); return hashCode; } }
@Override public int hashCode() { int hashCode = 0; Advisor[] advisors = this.advised.getAdvisors(); for (Advisor advisor : advisors) { Advice advice = advisor.getAdvice(); if (advice != null) { hashCode = 13 * hashCode + advice.getClass().hashCode(); } } hashCode = 13 * hashCode + (this.advised.isFrozen() ? 1 : 0); hashCode = 13 * hashCode + (this.advised.isExposeProxy() ? 1 : 0); hashCode = 13 * hashCode + (this.advised.isOptimize() ? 1 : 0); hashCode = 13 * hashCode + (this.advised.isOpaque() ? 1 : 0); return hashCode; } }
@Override public int hashCode() { int hashCode = 0; Advisor[] advisors = this.advised.getAdvisors(); for (Advisor advisor : advisors) { Advice advice = advisor.getAdvice(); if (advice != null) { hashCode = 13 * hashCode + advice.getClass().hashCode(); } } hashCode = 13 * hashCode + (this.advised.isFrozen() ? 1 : 0); hashCode = 13 * hashCode + (this.advised.isExposeProxy() ? 1 : 0); hashCode = 13 * hashCode + (this.advised.isOptimize() ? 1 : 0); hashCode = 13 * hashCode + (this.advised.isOpaque() ? 1 : 0); return hashCode; } }
Advisor[] thatAdvisors = otherAdvised.getAdvisors(); if (thisAdvisors.length != thatAdvisors.length) { return false;
/** * Create a new Cglib2AopProxy for the given config. * @throws AopConfigException if the config is invalid. We try to throw an informative * exception in this case, rather than let a mysterious failure happen later. */ protected Cglib2AopProxy(AdvisedSupport config) throws AopConfigException { if (config == null) { throw new AopConfigException("Cannot create AopProxy with null ProxyConfig"); } if (config.getAdvisors().length == 0 && config.getTargetSource() == AdvisedSupport.EMPTY_TARGET_SOURCE) { throw new AopConfigException("Cannot create AopProxy with no advisors and no target source"); } //DK - is this check really necessary? //should this 'config.getTargetSource() == AdvisedSupport.EMPTY_TARGET_SOURCE' be enough? if (config.getTargetSource().getTargetClass() == null) { throw new AopConfigException("Either an interface or a target is required for proxy creation"); } this.advised = config; }
Advisor[] thisAdvisors = this.advised.getAdvisors(); Advisor[] thatAdvisors = otherAdvised.getAdvisors(); if (thisAdvisors.length != thatAdvisors.length) { return false;
Advisor[] thisAdvisors = this.advised.getAdvisors(); Advisor[] thatAdvisors = otherAdvised.getAdvisors(); if (thisAdvisors.length != thatAdvisors.length) { return false;