Refine ReactorResourceFactory

1. Rename globalResources to useGlobalResources.
2. Use of global resources is mutually exlusive with explicit config.
3. Allow Consumer<HttpResources> to configure global resources.
4. Allow ConnectionProvider + LoopResources Supplier to customize
   creation and initialization.
5. Do not manage externally provided ConnectionProvider + LoopResources
   instances.

Issue: SPR-17243
This commit is contained in:
Rossen Stoyanchev
2018-09-05 21:17:04 -04:00
parent 3302798e2f
commit d537a1cfb4
2 changed files with 93 additions and 54 deletions

View File

@@ -94,7 +94,7 @@ concurrency. In this mode global resources remain active until the process exits
If the server is timed with the process, there is typically no need for an explicit
shutdown. However if the server can start or stop in-process, e.g. Spring MVC
application deployed as a WAR, you can declare a Spring-managed bean of type
`ReactorResourceFactory` with `globalResources=true` (the default) to ensure the Reactor
`ReactorResourceFactory` with `useGlobalResources=true` (the default) to ensure the Reactor
Netty global resources are shut down when the Spring `ApplicationContext` is closed:
[source,java,intent=0]