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.framework;
18:
19: /**
20: * Delegate interface for a configured AOP proxy, allowing for the creation
21: * of actual proxy objects.
22: *
23: * <p>Out-of-the-box implementations are available for JDK dynamic proxies
24: * and for CGLIB proxies, as applied by {@link DefaultAopProxyFactory}.
25: *
26: * @author Rod Johnson
27: * @author Juergen Hoeller
28: * @see DefaultAopProxyFactory
29: */
30: public interface AopProxy {
31:
32: /**
33: * Create a new proxy object.
34: * <p>Uses the AopProxy's default class loader (if necessary for proxy creation):
35: * usually, the thread context class loader.
36: * @return the new proxy object (never <code>null</code>)
37: * @see java.lang.Thread#getContextClassLoader()
38: */
39: Object getProxy();
40:
41: /**
42: * Create a new proxy object.
43: * <p>Uses the given class loader (if necessary for proxy creation).
44: * <code>null</code> will simply be passed down and thus lead to the low-level
45: * proxy facility's default, which is usually different from the default chosen
46: * by the AopProxy implementation's {@link #getProxy()} method.
47: * @param classLoader the class loader to create the proxy with
48: * (or <code>null</code> for the low-level proxy facility's default)
49: * @return the new proxy object (never <code>null</code>)
50: */
51: Object getProxy(ClassLoader classLoader);
52:
53: }
|