Introduced SimpleTransactionScope (analogous to SimpleThreadScope)

Issue: SPR-13085
This commit is contained in:
Juergen Hoeller
2015-06-18 00:29:46 +02:00
parent 042519043f
commit f1c7dc4f4b
3 changed files with 247 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,9 +29,14 @@ import org.springframework.core.NamedThreadLocal;
/**
* A simple thread-backed {@link Scope} implementation.
*
* <p><strong>Note:</strong> {@code SimpleThreadScope} <em>does not clean up
* any objects</em> associated with it. As such, it is typically preferable to
* use {@link org.springframework.web.context.request.RequestScope RequestScope}
* <p><b>NOTE:</b> This thread 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
* {@link org.springframework.beans.factory.config.ConfigurableBeanFactory#registerScope}
* or through a {@link org.springframework.beans.factory.config.CustomScopeConfigurer} bean.
*
* <p>{@code SimpleThreadScope} <em>does not clean up any objects</em> associated with it.
* As such, it is typically preferable to use
* {@link org.springframework.web.context.request.RequestScope RequestScope}
* in web environments.
*
* <p>For an implementation of a thread-based {@code Scope} with support for