Top Description Fields Constructors Methods
org.springframework.aop.framework

public Class ProxyConfig

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Known Direct Subclasses
org.springframework.aop.framework.ProxyProcessorSupport, org.springframework.aop.scope.ScopedProxyFactoryBean, org.springframework.aop.framework.AbstractSingletonProxyFactoryBean, org.springframework.aop.framework.AdvisedSupport
Imports
java.io.Serializable, org.springframework.util.Assert

Convenience superclass for configuration used in creating proxies, to ensure that all proxy creators have consistent properties.
Authors
Rod Johnson, Juergen Hoeller
See Also
AdvisedSupport

Field Summary

Modifier and TypeField and Description
pack-priv boolean
private boolean
pack-priv boolean
private boolean
private boolean
private static final long
serialVersionUID

use serialVersionUID from Spring 1.2 for interoperability.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
copyFrom(ProxyConfig
object to copy configuration from
other
)

Copy configuration from the other config object.

public boolean
isExposeProxy()

Return whether the AOP proxy will expose the AOP proxy for each invocation.

public boolean
isFrozen()

Return whether the config is frozen, and no advice changes can be made.

public boolean
isOpaque()

Return whether proxies created by this configuration should be prevented from being cast to Advised.

public boolean
isOptimize()

Return whether proxies should perform aggressive optimizations.

public boolean
isProxyTargetClass()

Return whether to proxy the target class directly as well as any interfaces.

public void
setExposeProxy(boolean exposeProxy)

Set whether the proxy should be exposed by the AOP framework as a ThreadLocal for retrieval via the AopContext class.

public void
setFrozen(boolean frozen)

Set whether this config should be frozen.

public void
setOpaque(boolean opaque)

Set whether proxies created by this configuration should be prevented from being cast to Advised to query proxy status.

public void
setOptimize(boolean optimize)

Set whether proxies should perform aggressive optimizations.

public void
setProxyTargetClass(boolean proxyTargetClass)

Set whether to proxy the target class directly, instead of just proxying specific interfaces.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

exposeProxyback to summary
pack-priv boolean exposeProxy
frozenback to summary
private boolean frozen
opaqueback to summary
pack-priv boolean opaque
optimizeback to summary
private boolean optimize
proxyTargetClassback to summary
private boolean proxyTargetClass
serialVersionUIDback to summary
private static final long serialVersionUID

use serialVersionUID from Spring 1.2 for interoperability.

Constructor Detail

ProxyConfigback to summary
public ProxyConfig()

Method Detail

copyFromback to summary
public void copyFrom(ProxyConfig other)

Copy configuration from the other config object.

Parameters
other:ProxyConfig

object to copy configuration from

isExposeProxyback to summary
public boolean isExposeProxy()

Return whether the AOP proxy will expose the AOP proxy for each invocation.

isFrozenback to summary
public boolean isFrozen()

Return whether the config is frozen, and no advice changes can be made.

isOpaqueback to summary
public boolean isOpaque()

Return whether proxies created by this configuration should be prevented from being cast to Advised.

isOptimizeback to summary
public boolean isOptimize()

Return whether proxies should perform aggressive optimizations.

isProxyTargetClassback to summary
public boolean isProxyTargetClass()

Return whether to proxy the target class directly as well as any interfaces.

setExposeProxyback to summary
public void setExposeProxy(boolean exposeProxy)

Set whether the proxy should be exposed by the AOP framework as a ThreadLocal for retrieval via the AopContext class. This is useful if an advised object needs to call another advised method on itself. (If it uses this, the invocation will not be advised).

Default is "false", in order to avoid unnecessary extra interception. This means that no guarantees are provided that AopContext access will work consistently within any method of the advised object.

setFrozenback to summary
public void setFrozen(boolean frozen)

Set whether this config should be frozen.

When a config is frozen, no advice changes can be made. This is useful for optimization, and useful when we don't want callers to be able to manipulate configuration after casting to Advised.

setOpaqueback to summary
public void setOpaque(boolean opaque)

Set whether proxies created by this configuration should be prevented from being cast to Advised to query proxy status.

Default is "false", meaning that any AOP proxy can be cast to Advised.

setOptimizeback to summary
public void setOptimize(boolean optimize)

Set whether proxies should perform aggressive optimizations. The exact meaning of "aggressive optimizations" will differ between proxies, but there is usually some tradeoff. Default is "false".

With Spring's current proxy options, this flag effectively enforces CGLIB proxies (similar to setProxyTargetClass) but without any class validation checks (for final methods etc).

setProxyTargetClassback to summary
public void setProxyTargetClass(boolean proxyTargetClass)

Set whether to proxy the target class directly, instead of just proxying specific interfaces. Default is "false".

Set this to "true" to force proxying for the TargetSource's exposed target class. If that target class is an interface, a JDK proxy will be created for the given interface. If that target class is any other class, a CGLIB proxy will be created for the given class.

Note

Depending on the configuration of the concrete proxy factory, the proxy-target-class behavior will also be applied if no interfaces have been specified (and no interface autodetection is activated).

See Also
org.springframework.aop.TargetSource#getTargetClass()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override