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 DynamicAdviceFactory} acts as a provider of advices based on specific types. 24 * 25 * @author Simon Wacker 26 */ 27 interface org.as2lib.aop.advice.DynamicAdviceFactory extends BasicInterface { 28 29 /** 30 * @overload #getAdviceByTypeAndStringAndCall 31 * @overload #getAdviceByTypeAndPointcutAndCall 32 */ 33 public function getAdvice():Advice; 34 35 /** 36 * Returns the advice corresponding to the given {@code type}. The returned advice 37 * uses the passed-in {@code pointcut} and {@code callback}. 38 * 39 * <p>The {@code callback} is invoked if the {@code execute} method of the returned 40 * advice is executed. 41 * 42 * <p>Commonly supported types are defined as constants in the 43 * {@link AbstractAdvice} class. 44 * 45 * @param type the type of the advice to return 46 * @param pointcut the string representation of a pointcut used by the returned advice 47 * @param callback the callback that is executed if you invoke the {@code execute} 48 * method on the returned advice 49 * @return the advice corresponding to the type and configured with the given 50 * {@code pointcut} and {@code callback} 51 */ 52 public function getAdviceByTypeAndStringAndCall(type:Number, pointcut:String, callback:Call):Advice; 53 54 /** 55 * Returns the advice corresponding to the given {@code type}. The returned advice 56 * uses the passed-in {@code pointcut} and {@code callback}. 57 * 58 * <p>The {@code callback} is invoked if the {@code execute} method of the returned 59 * advice is executed. 60 * 61 * <p>Commonly supported types are defined as constants in the 62 * {@link AbstractAdvice} class. 63 * 64 * @param type the type of the advice to return 65 * @param pointcut the pointcut used by the returned advice 66 * @param callback the callback that is executed if you invoke the {@code execute} 67 * method on the returned advice 68 * @return the advice corresponding to the type and configured with the given 69 * {@code pointcut} and {@code callback} 70 */ 71 public function getAdviceByTypeAndPointcutAndCall(type:Number, pointcut:Pointcut, callback:Call):Advice; 72 73 }