程序包 infra.aop.scope

类 DefaultScopedObject

java.lang.Object
infra.aop.scope.DefaultScopedObject
所有已实现的接口:
RawTargetAccess, ScopedObject, Serializable

public class DefaultScopedObject extends Object implements ScopedObject, Serializable
Default implementation of the ScopedObject interface.

Simply delegates the calls to the underlying bean factory (BeanFactory.getBean(String)/ ConfigurableBeanFactory.destroyScopedBean(String)).

从以下版本开始:
4.0
作者:
Juergen Hoeller
另请参阅:
  • BeanFactory.getBean(java.lang.String)
  • ConfigurableBeanFactory.destroyScopedBean(java.lang.String)
  • 序列化表格
  • 字段详细资料

    • beanFactory

      private final infra.beans.factory.config.ConfigurableBeanFactory beanFactory
    • targetBeanName

      private final String targetBeanName
  • 构造器详细资料

    • DefaultScopedObject

      public DefaultScopedObject(infra.beans.factory.config.ConfigurableBeanFactory beanFactory, String targetBeanName)
      Creates a new instance of the DefaultScopedObject class.
      参数:
      beanFactory - the ConfigurableBeanFactory that holds the scoped target object
      targetBeanName - the name of the target bean
  • 方法详细资料

    • getTargetObject

      public Object getTargetObject()
      从接口复制的说明: ScopedObject
      Return the current target object behind this scoped object proxy, in its raw form (as stored in the target scope).

      The raw target object can for example be passed to persistence providers which would not be able to handle the scoped proxy object.

      指定者:
      getTargetObject 在接口中 ScopedObject
      返回:
      the current target object behind this scoped object proxy
    • removeFromScope

      public void removeFromScope()
      从接口复制的说明: ScopedObject
      Remove this object from its target scope, for example from the backing session.

      Note that no further calls may be made to the scoped object afterwards (at least within the current thread, that is, with the exact same target object in the target scope).

      指定者:
      removeFromScope 在接口中 ScopedObject