Class SimpleTransactionScope

java.lang.Object
org.springframework.transaction.support.SimpleTransactionScope
All Implemented Interfaces:
org.springframework.beans.factory.config.Scope

public class SimpleTransactionScope extends Object implements org.springframework.beans.factory.config.Scope
A simple transaction-backed Scope implementation, delegating to TransactionSynchronizationManager's resource binding mechanism.

NOTE: Like SimpleThreadScope, this transaction scope is not registered by default in common contexts. Instead, you need to explicitly assign it to a scope key in your setup, either through ConfigurableBeanFactory.registerScope(java.lang.String, org.springframework.beans.factory.config.Scope) or through a CustomScopeConfigurer bean.

Since:
4.2
Author:
Juergen Hoeller
See Also:
  • SimpleThreadScope
  • ConfigurableBeanFactory.registerScope(java.lang.String, org.springframework.beans.factory.config.Scope)
  • CustomScopeConfigurer
  • Constructor Details

    • SimpleTransactionScope

      public SimpleTransactionScope()
  • Method Details

    • get

      public Object get(String name, org.springframework.beans.factory.ObjectFactory<?> objectFactory)
      Specified by:
      get in interface org.springframework.beans.factory.config.Scope
    • remove

      @Nullable public Object remove(String name)
      Specified by:
      remove in interface org.springframework.beans.factory.config.Scope
    • registerDestructionCallback

      public void registerDestructionCallback(String name, Runnable callback)
      Specified by:
      registerDestructionCallback in interface org.springframework.beans.factory.config.Scope
    • resolveContextualObject

      @Nullable public Object resolveContextualObject(String key)
      Specified by:
      resolveContextualObject in interface org.springframework.beans.factory.config.Scope
    • getConversationId

      @Nullable public String getConversationId()
      Specified by:
      getConversationId in interface org.springframework.beans.factory.config.Scope