KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > aop > support > DynamicMethodMatcherPointcutAdvisor


1 /*
2  * Copyright 2002-2007 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.support;
18
19 import java.io.Serializable JavaDoc;
20
21 import org.aopalliance.aop.Advice;
22
23 import org.springframework.aop.Pointcut;
24 import org.springframework.aop.PointcutAdvisor;
25 import org.springframework.core.Ordered;
26 import org.springframework.util.Assert;
27
28 /**
29  * Convenient superclass for Advisors that are also dynamic pointcuts.
30  * Serializable if both Advice and Advisor subclass are.
31  *
32  * @author Rod Johnson
33  * @author Rob Harrop
34  * @deprecated since 2.0, in favor of using {@link DefaultPointcutAdvisor}
35  * with a runtime {@link DynamicMethodMatcherPointcut}
36  */

37 public abstract class DynamicMethodMatcherPointcutAdvisor extends DynamicMethodMatcherPointcut
38     implements PointcutAdvisor, Ordered, Serializable JavaDoc {
39
40     private int order = Integer.MAX_VALUE;
41
42     private Advice advice;
43
44
45     /**
46      * Create a new DynamicMethodMatcherPointcutAdvisor,
47      * expecting bean-style configuration.
48      * @see #setAdvice
49      */

50     protected DynamicMethodMatcherPointcutAdvisor() {
51     }
52
53     /**
54      * Create a new DynamicMethodMatcherPointcutAdvisor for the given advice.
55      * @param advice the Advice to use
56      */

57     protected DynamicMethodMatcherPointcutAdvisor(Advice advice) {
58         Assert.notNull(advice, "Advice must not be null");
59         this.advice = advice;
60     }
61
62
63     public void setOrder(int order) {
64         this.order = order;
65     }
66
67     public int getOrder() {
68         return this.order;
69     }
70
71     public void setAdvice(Advice advice) {
72         this.advice = advice;
73     }
74
75     public Advice getAdvice() {
76         return this.advice;
77     }
78
79     public boolean isPerInstance() {
80         return true;
81     }
82
83     public final Pointcut getPointcut() {
84         return this;
85     }
86
87 }
88
Popular Tags