Package org.springframework.aop.framework

# Class DefaultAopProxyFactory

java.lang.Object
org.springframework.aop.framework.DefaultAopProxyFactory

All Implemented Interfaces:
  `Serializable`, `AopProxyFactory`

public class DefaultAopProxyFactory extends Object implements AopProxyFactory, Serializable
Default `AopProxyFactory` implementation, creating either a CGLIB proxy or a JDK dynamic proxy.

Creates a CGLIB proxy if one the following is true for a given `AdvisedSupport` instance:

- the `optimize` flag is set
- the `proxyTargetClass` flag is set
- no proxy interfaces have been specified

In general, specify `proxyTargetClass` to enforce a CGLIB proxy, or specify one or more interfaces to use a JDK dynamic proxy.

Since:
  12.03.2004
Author:
  Rod Johnson, Juergen Hoeller, Sebastien Deleuze, Sam Brannen
See Also:
  - `ProxyConfig.setOptimize(boolean)`
  - `ProxyConfig.setProxyTargetClass(boolean)`
  - `AdvisedSupport.setInterfaces(java.lang.Class<?>...)`
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final DefaultAopProxyFactory`
`INSTANCE`
Singleton instance of this class.

## Constructor Summary

Constructors
Constructor
Description
`DefaultAopProxyFactory()`

## Method Summary

Modifier and Type
Method
Description
`AopProxy`
`createAopProxy(AdvisedSupport config)`
Create an `AopProxy` for the given AOP configuration.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### INSTANCE

public static final DefaultAopProxyFactory INSTANCE
Singleton instance of this class.

Since:
  6.0.10

## Constructor Details

### DefaultAopProxyFactory

public DefaultAopProxyFactory()

## Method Details

### createAopProxy

public AopProxy createAopProxy(AdvisedSupport config) throws AopConfigException
Description copied from interface: `AopProxyFactory`
Create an `AopProxy` for the given AOP configuration.

Specified by:
  `createAopProxy` in interface `AopProxyFactory`
Parameters:
  `config` - the AOP configuration in the form of an AdvisedSupport object
Returns:
  the corresponding AOP proxy
Throws:
  `AopConfigException` - if the configuration is invalid