View Javadoc
1   /*
2    * Copyright 2002-2006 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
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  package org.springframework.aop.aspectj;
18  
19  import org.springframework.core.Ordered;
20  
21  /**
22   * Interface to be implemented by types that can supply the information
23   * needed to sort advice/advisors by AspectJ's precedence rules.
24   *
25   * @author Adrian Colyer
26   * @since 2.0
27   * @see org.springframework.aop.aspectj.autoproxy.AspectJPrecedenceComparator
28   */
29  public interface AspectJPrecedenceInformation extends Ordered {
30  
31  	// Implementation note:
32  	// We need the level of indirection this interface provides as otherwise the
33  	// AspectJPrecedenceComparator must ask an Advisor for its Advice in all cases
34  	// in order to sort advisors. This causes problems with the
35  	// InstantiationModelAwarePointcutAdvisor which needs to delay creating
36  	// its advice for aspects with non-singleton instantiation models.
37  
38  	/**
39  	 * The name of the aspect (bean) in which the advice was declared.
40  	 */
41  	String getAspectName();
42  
43  	/**
44  	 * The declaration order of the advice member within the aspect.
45  	 */
46  	int getDeclarationOrder();
47  
48  	/**
49  	 * Return whether this is a before advice.
50  	 */
51  	boolean isBeforeAdvice();
52  
53  	/**
54  	 * Return whether this is an after advice.
55  	 */
56  	boolean isAfterAdvice();
57  
58  }