程序包 infra.aop.scope

类 ScopedProxyFactoryBean

java.lang.Object
infra.aop.framework.ProxyConfig
infra.aop.scope.ScopedProxyFactoryBean
所有已实现的接口:
AopInfrastructureBean, infra.beans.factory.Aware, infra.beans.factory.BeanFactoryAware, infra.beans.factory.FactoryBean<Object>, Serializable

public class ScopedProxyFactoryBean extends ProxyConfig implements infra.beans.factory.FactoryBean<Object>, infra.beans.factory.BeanFactoryAware, AopInfrastructureBean
Convenient proxy factory bean for scoped objects.

Proxies created using this factory bean are thread-safe singletons and may be injected into shared objects, with transparent scoping behavior.

Proxies returned by this class implement the ScopedObject interface. This presently allows for removing the corresponding object from the scope, seamlessly creating a new instance in the scope on next access.

Please note that the proxies created by this factory are class-based proxies by default. This can be customized through switching the "proxyTargetClass" property to "false".

从以下版本开始:
4.0
作者:
Rod Johnson, Juergen Hoeller
另请参阅:
  • 字段详细资料

    • scopedTargetSource

      private final SimpleBeanTargetSource scopedTargetSource
      The TargetSource that manages scoping.
    • targetBeanName

      @Nullable private String targetBeanName
      The name of the target bean.
    • proxy

      @Nullable private Object proxy
      The cached singleton proxy.
  • 构造器详细资料

    • ScopedProxyFactoryBean

      public ScopedProxyFactoryBean()
      Create a new ScopedProxyFactoryBean instance.
  • 方法详细资料

    • setTargetBeanName

      public void setTargetBeanName(String targetBeanName)
      Set the name of the bean that is to be scoped.
    • setBeanFactory

      public void setBeanFactory(infra.beans.factory.BeanFactory beanFactory)
      指定者:
      setBeanFactory 在接口中 infra.beans.factory.BeanFactoryAware
    • getObject

      public Object getObject()
      指定者:
      getObject 在接口中 infra.beans.factory.FactoryBean<Object>
    • getObjectType

      public Class<?> getObjectType()
      指定者:
      getObjectType 在接口中 infra.beans.factory.FactoryBean<Object>
    • isSingleton

      public boolean isSingleton()
      指定者:
      isSingleton 在接口中 infra.beans.factory.FactoryBean<Object>