Ejemplo n.º 1
0
        /// <summary>
        /// Wraps the supplied <paramref name="advisor"/>'s
        /// <see cref="Spring.Aop.IAdvisor.Advice"/> within a
        /// <see cref="Spring.Aop.Framework.Adapter.MethodBeforeAdviceInterceptor"/>
        /// instance.
        /// </summary>
        /// <param name="advisor">
        /// The advisor exposing the <see cref="AopAlliance.Aop.IAdvice"/> that
        /// is to be wrapped.
        /// </param>
        /// <returns>
        /// The supplied <paramref name="advisor"/>'s
        /// <see cref="Spring.Aop.IAdvisor.Advice"/> wrapped within a
        /// <see cref="Spring.Aop.Framework.Adapter.MethodBeforeAdviceInterceptor"/>
        /// instance.
        /// </returns>
        public virtual IInterceptor GetInterceptor(IAdvisor advisor)
        {
            IMethodBeforeAdvice advice = (IMethodBeforeAdvice)advisor.Advice;

            return(new MethodBeforeAdviceInterceptor(advice));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a new instance of the
 /// <see cref="Spring.Aop.Framework.Adapter.MethodBeforeAdviceInterceptor"/>
 /// class.
 /// </summary>
 /// <param name="advice">
 /// The <see cref="Spring.Aop.IMethodBeforeAdvice"/> that is to be wrapped.
 /// </param>
 /// <exception cref="System.ArgumentNullException">
 /// If the supplied <paramref name="advice"/> is <see langword="null"/>.
 /// </exception>
 public MethodBeforeAdviceInterceptor(IMethodBeforeAdvice advice)
 {
     AssertUtils.ArgumentNotNull(advice, "advice");
     this.advice = advice;
 }
 /// <summary>
 /// Creates a new instance of the
 /// <see cref="Spring.Aop.Framework.Adapter.MethodBeforeAdviceInterceptor"/>
 /// class.
 /// </summary>
 /// <param name="advice">
 /// The <see cref="Spring.Aop.IMethodBeforeAdvice"/> that is to be wrapped.
 /// </param>
 /// <exception cref="System.ArgumentNullException">
 /// If the supplied <paramref name="advice"/> is <see langword="null"/>.
 /// </exception>
 public MethodBeforeAdviceInterceptor(IMethodBeforeAdvice advice)
 {
     AssertUtils.ArgumentNotNull(advice, "advice");
     this.advice = advice;
 }