1  /*
     2   * Copyright the original author or authors.
     3   * 
     4   * Licensed under the MOZILLA PUBLIC LICENSE, Version 1.1 (the "License");
     5   * you may not use this file except in compliance with the License.
     6   * You may obtain a copy of the License at
     7   * 
     8   *      http://www.mozilla.org/MPL/MPL-1.1.html
     9   * 
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS,
    12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13   * See the License for the specific language governing permissions and
    14   * limitations under the License.
    15   */
    16  
    17  import org.as2lib.aop.Aspect;
    18  import org.as2lib.aop.JoinPoint;
    19  import org.as2lib.aop.advice.AbstractAdvice;
    20  import org.as2lib.aop.advice.AroundAdvice;
    21  
    22  /**
    23   * {@code AbstractAroundAdvice} provides implementations of methods commonly needed
    24   * by {@link AroundAdvice} implementations.
    25   * 
    26   * @author Simon Wacker
    27   */
    28  class org.as2lib.aop.advice.AbstractAroundAdvice extends AbstractAdvice {
    29  	
    30  	/**
    31  	 * Constructs a new {@code AbstractAroundAdvice} instance.
    32  	 * 
    33  	 * @param aspect (optional) the aspect that contains this advice
    34  	 */
    35  	private function AbstractAroundAdvice(aspect:Aspect) {
    36  		super(aspect);
    37  	}
    38  	
    39  	/**
    40  	 * Executes this advice's {@code execute} method, passing the given
    41  	 * {@code joinPoint} and the given {@code args}.
    42  	 * 
    43  	 * @param joinPoint the reached join point
    44  	 * @param args the arguments used to invoke the join point
    45  	 * @return the result of the execution of this advice's {@code execute} method
    46  	 * @throws * if the execution of tis adivce's {@code execute} method results in an
    47  	 * exception
    48  	 */
    49  	private function executeJoinPoint(joinPoint:JoinPoint, args:Array) {
    50  		return AroundAdvice(this).execute(joinPoint, args);
    51  	}
    52  	
    53  }