01: /*
02: * Copyright 2002-2006 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.aspectj;
18:
19: import java.lang.reflect.Method;
20:
21: import org.springframework.aop.MethodBeforeAdvice;
22:
23: /**
24: * Spring AOP advice that wraps an AspectJ before method.
25: *
26: * @author Rod Johnson
27: * @author Adrian Colyer
28: * @since 2.0
29: */
30: public class AspectJMethodBeforeAdvice extends AbstractAspectJAdvice
31: implements MethodBeforeAdvice {
32:
33: public AspectJMethodBeforeAdvice(Method aspectJBeforeAdviceMethod,
34: AspectJExpressionPointcut pointcut,
35: AspectInstanceFactory aif) {
36:
37: super (aspectJBeforeAdviceMethod, pointcut, aif);
38: }
39:
40: public void before(Method method, Object[] args, Object target)
41: throws Throwable {
42: invokeAdviceMethod(getJoinPointMatch(), null, null);
43: }
44:
45: public boolean isBeforeAdvice() {
46: return true;
47: }
48:
49: public boolean isAfterAdvice() {
50: return false;
51: }
52:
53: }
|