KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > aop > framework > AdvisorChainFactoryUtils


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.framework;
18
19 import java.lang.reflect.Method JavaDoc;
20 import java.util.List JavaDoc;
21
22 /**
23  * Utility methods for use by {@link AdvisorChainFactory} implementations.
24  *
25  * <p>The {@link #calculateInterceptorsAndDynamicInterceptionAdvice} method
26  * is the definitive way of working out an advice chain for a Method,
27  * given an {@link Advised} object.
28  *
29  * @author Rod Johnson
30  * @author Juergen Hoeller
31  * @deprecated as of Spring 2.0.3, in favor of {@link DefaultAdvisorChainFactory}.
32  * This utility class will be removed in Spring 2.1.
33  */

34 public abstract class AdvisorChainFactoryUtils {
35
36     /**
37      * Canonical instance of a simple AdvisorChainFactory implementation.
38      */

39     public static final AdvisorChainFactory SIMPLE_ADVISOR_CHAIN_FACTORY = new DefaultAdvisorChainFactory();
40
41
42     /**
43      * Return the static interceptors and dynamic interception advice that may apply
44      * to this method invocation.
45      * @param config the AOP configuration in the form of an Advised object
46      * @param proxy the proxy object
47      * @param method the proxied method
48      * @param targetClass the target class
49      * @return List of MethodInterceptors (may also include InterceptorAndDynamicMethodMatchers)
50      * @see AdvisorChainFactory
51      */

52     public static List JavaDoc calculateInterceptorsAndDynamicInterceptionAdvice(
53             Advised config, Object JavaDoc proxy, Method JavaDoc method, Class JavaDoc targetClass) {
54
55         return SIMPLE_ADVISOR_CHAIN_FACTORY.getInterceptorsAndDynamicInterceptionAdvice(
56                 config, proxy, method, targetClass);
57     }
58
59 }
60
Popular Tags