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.core.BasicInterface;
    18  import org.as2lib.app.exec.Call;
    19  import org.as2lib.aop.Advice;
    20  import org.as2lib.aop.Pointcut;
    21  
    22  /**
    23   * {@code AdviceFactory} acts as provider for instances of type {@link Advice}.
    24   * 
    25   * @author Simon Wacker
    26   */
    27  interface org.as2lib.aop.advice.AdviceFactory extends BasicInterface {
    28  	
    29  	/**
    30  	 * @overload #getAdviceByStringAndCall
    31  	 * @overload #getAdviceByPointcutAndCall
    32  	 */
    33  	public function getAdvice():Advice;
    34  	
    35  	/**
    36  	 * Returns an advice configured for the given {@code pointcut} string and
    37  	 * {@code callback}.
    38  	 *
    39  	 * @param pointcut the string representation of a pointcut used by the returned advice
    40  	 * @param callback the callback that is executed if you invoke the {@code execute}
    41  	 * method on the returned advice
    42  	 * @return an advice that is configured with the given {@code pointcut} and
    43  	 * {@code callback}
    44  	 */
    45  	public function getAdviceByStringAndCall(pointcut:String, callback:Call):Advice;
    46  	
    47  	/**
    48  	 * Returns an advice configured for the given {@code pointcut} and {@code callback}.
    49  	 *
    50  	 * @param pointcut the pointcut used by the returned advice
    51  	 * @param callback the callback that is executed if you invoke the {@code execute}
    52  	 * method on the returned advice
    53  	 * @return an advice that is configured with the given {@code pointcut} and
    54  	 * {@code callback}
    55  	 */
    56  	public function getAdviceByPointcutAndCall(pointcut:Pointcut, callback:Call):Advice;
    57  	
    58  }