01: /*
02: * Copyright 2002-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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;
20:
21: import org.springframework.aop.PointcutAdvisor;
22: import org.springframework.core.Ordered;
23: import org.springframework.util.ObjectUtils;
24:
25: /**
26: * Abstract base class for {@link org.springframework.aop.PointcutAdvisor}
27: * implementations. Can be subclassed for returning a specific pointcut/advice
28: * or a freely configurable pointcut/advice.
29: *
30: * @author Rod Johnson
31: * @author Juergen Hoeller
32: * @since 1.1.2
33: * @see AbstractGenericPointcutAdvisor
34: */
35: public abstract class AbstractPointcutAdvisor implements
36: PointcutAdvisor, Ordered, Serializable {
37:
38: private int order = Ordered.LOWEST_PRECEDENCE;
39:
40: public void setOrder(int order) {
41: this .order = order;
42: }
43:
44: public int getOrder() {
45: return this .order;
46: }
47:
48: public boolean isPerInstance() {
49: return true;
50: }
51:
52: public boolean equals(Object other) {
53: if (this == other) {
54: return true;
55: }
56: if (!(other instanceof PointcutAdvisor)) {
57: return false;
58: }
59: PointcutAdvisor otherAdvisor = (PointcutAdvisor) other;
60: return (ObjectUtils.nullSafeEquals(getAdvice(), otherAdvisor
61: .getAdvice()) && ObjectUtils.nullSafeEquals(
62: getPointcut(), otherAdvisor.getPointcut()));
63: }
64:
65: public int hashCode() {
66: return PointcutAdvisor.class.hashCode();
67: }
68:
69: }
|