类 ProxyConfig

java.lang.Object
infra.aop.framework.ProxyConfig
所有已实现的接口:
Serializable
直接已知子类:
AbstractSingletonProxyFactoryBean, AdvisedSupport, ProxyProcessorSupport, ScopedProxyFactoryBean

public class ProxyConfig extends Object implements Serializable
Convenience superclass for configuration used in creating proxies, to ensure that all proxy creators have consistent properties.
从以下版本开始:
3.0
作者:
Rod Johnson, Juergen Hoeller, TODAY 2021/2/1 20:23
另请参阅:
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    (专用程序包) boolean
     
    private boolean
     
    (专用程序包) boolean
     
    private boolean
     
    private boolean
     
    private static final long
     
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    Copy configuration from the other config object.
    boolean
    Return whether the AOP proxy will expose the AOP proxy for each invocation.
    boolean
    Return whether the config is frozen, and no advice changes can be made.
    boolean
    Return whether proxies created by this configuration should be prevented from being cast to Advised.
    boolean
    Return whether proxies should perform aggressive optimizations.
    boolean
    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.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 字段详细资料

    • serialVersionUID

      private static final long serialVersionUID
      另请参阅:
    • opaque

      boolean opaque
    • exposeProxy

      boolean exposeProxy
    • frozen

      private boolean frozen
    • optimize

      private boolean optimize
    • proxyTargetClass

      private boolean proxyTargetClass
  • 构造器详细资料

    • ProxyConfig

      public ProxyConfig()
  • 方法详细资料

    • setProxyTargetClass

      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 Standard 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 auto-detection is activated).

      另请参阅:
    • isProxyTargetClass

      public boolean isProxyTargetClass()
      Return whether to proxy the target class directly as well as any interfaces.
    • setOptimize

      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 current proxy options, this flag effectively enforces CGLIB proxies (similar to setProxyTargetClass(boolean)) but without any class validation checks (for final methods etc).

    • isOptimize

      public boolean isOptimize()
      Return whether proxies should perform aggressive optimizations.
    • setOpaque

      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.

    • isOpaque

      public boolean isOpaque()
      Return whether proxies created by this configuration should be prevented from being cast to Advised.
    • setExposeProxy

      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.

    • isExposeProxy

      public boolean isExposeProxy()
      Return whether the AOP proxy will expose the AOP proxy for each invocation.
    • setFrozen

      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.

    • isFrozen

      public boolean isFrozen()
      Return whether the config is frozen, and no advice changes can be made.
    • copyFrom

      public void copyFrom(ProxyConfig other)
      Copy configuration from the other config object.
      参数:
      other - object to copy configuration from
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object