public class ProxyConfig
extends java.lang.Object
implements java.io.Serializable
AdvisedSupport
,
Serialized FormConstructor and Description |
---|
ProxyConfig() |
Modifier and Type | Method and Description |
---|---|
void |
copyFrom(ProxyConfig other)
Copy configuration from the other config object.
|
boolean |
isExposeProxy()
Return whether the AOP proxy will expose the AOP proxy for
each invocation.
|
boolean |
isFrozen()
Return whether the config is frozen, and no advice changes can be made.
|
boolean |
isOpaque()
Return whether proxies created by this configuration should be
prevented from being cast to
Advised . |
boolean |
isOptimize()
Return whether proxies should perform aggressive optimizations.
|
boolean |
isProxyTargetClass()
Return whether to proxy the target class directly as well as any interfaces.
|
void |
setExposeProxy(boolean exposeProxy)
Set whether the proxy should be exposed by the AOP framework as a
ThreadLocal for retrieval via the AopContext class.
|
void |
setFrozen(boolean frozen)
Set whether this config should be frozen.
|
void |
setOpaque(boolean opaque)
Set whether proxies created by this configuration should be prevented
from being cast to
Advised to query proxy status. |
void |
setOptimize(boolean optimize)
Set whether proxies should perform aggressive optimizations.
|
void |
setProxyTargetClass(boolean proxyTargetClass)
Set whether to proxy the target class directly, instead of just proxying
specific interfaces.
|
java.lang.String |
toString() |
public void setProxyTargetClass(boolean proxyTargetClass)
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).
TargetSource.getTargetClass()
public boolean isProxyTargetClass()
public void setOptimize(boolean optimize)
For example, optimization will usually mean that advice changes won't take effect after a proxy has been created. For this reason, optimization is disabled by default. An optimize value of "true" may be ignored if other settings preclude optimization: for example, if "exposeProxy" is set to "true" and that's not compatible with the optimization.
public boolean isOptimize()
public void setOpaque(boolean opaque)
public boolean isOpaque()
Advised
.public void setExposeProxy(boolean exposeProxy)
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.
public boolean isExposeProxy()
public void setFrozen(boolean 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.
public boolean isFrozen()
public void copyFrom(ProxyConfig other)
other
- object to copy configuration frompublic java.lang.String toString()
toString
in class java.lang.Object