LoopResources for
event loop threads, and ConnectionProvider for the connection pool,
within the lifecycle of a Spring ApplicationContext.
This factory implements InitializingBean, DisposableBean
and Lifecycle and is expected typically to be declared as a
Spring-managed bean.
Notice that after a Lifecycle stop/restart, new instances of
the configured LoopResources and ConnectionProvider are
created, so any references to those should be updated.
| Modifier and Type | Field and Description |
|---|---|
| private ConnectionProvider | |
| private Supplier | |
| private Consumer | |
| private final Object | |
| private LoopResources | |
| private Supplier | |
| private boolean | |
| private boolean | |
| private volatile boolean | |
| private Duration | |
| private Duration | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addGlobalResourcesConsumer(Consumer<HttpResources>
the consumer to apply consumer)Add a Consumer for configuring the global Reactor Netty resources on startup. |
| public void | afterPropertiesSet()
Implements org. Invoked by the containing This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set. |
| public void | destroy()
Implements org. Invoked by the containing |
| public ConnectionProvider | |
| public LoopResources | |
| public boolean | isRunning()
Implements org. Check whether this component is currently running. |
| public boolean | |
| public void | setConnectionProvider(ConnectionProvider
the connection provider to use as is connectionProvider)Use this when you want to provide an externally managed
|
| public void | setConnectionProviderSupplier(Supplier<ConnectionProvider>
the supplier to use supplier)Use this when you don't want to participate in global resources and
you want to customize the creation of the managed |
| public void | setLoopResources(LoopResources
the loop resources to use as is loopResources)Use this option when you want to provide an externally managed
|
| public void | setLoopResourcesSupplier(Supplier<LoopResources>
the supplier to use supplier)Use this when you don't want to participate in global resources and
you want to customize the creation of the managed |
| public void | setShutdownQuietPeriod(Duration shutdownQuietPeriod)
Configure the amount of time we'll wait before shutting down resources. |
| public void | setShutdownTimeout(Duration shutdownTimeout)
Configure the maximum amount of time to wait until the disposal of the
underlying resources regardless if a task was submitted during the
|
| public void | setUseGlobalResources(boolean
whether to expose and manage the global resources useGlobalResources)Whether to use global Reactor Netty resources via |
| public void | |
| public void | stop()
Implements org. Stop this component, typically in a synchronous fashion, such that the component is fully stopped upon return of this method. |
| connectionProvider | back to summary |
|---|---|
| private ConnectionProvider connectionProvider
| |
| connectionProviderSupplier | back to summary |
|---|---|
| private Supplier<ConnectionProvider> connectionProviderSupplier | |
| globalResourcesConsumer | back to summary |
|---|---|
| private Consumer<HttpResources> globalResourcesConsumer
| |
| lifecycleMonitor | back to summary |
|---|---|
| private final Object lifecycleMonitor | |
| loopResources | back to summary |
|---|---|
| private LoopResources loopResources
| |
| loopResourcesSupplier | back to summary |
|---|---|
| private Supplier<LoopResources> loopResourcesSupplier | |
| manageConnectionProvider | back to summary |
|---|---|
| private boolean manageConnectionProvider | |
| manageLoopResources | back to summary |
|---|---|
| private boolean manageLoopResources | |
| running | back to summary |
|---|---|
| private volatile boolean running | |
| shutdownQuietPeriod | back to summary |
|---|---|
| private Duration shutdownQuietPeriod | |
| shutdownTimeout | back to summary |
|---|---|
| private Duration shutdownTimeout | |
| useGlobalResources | back to summary |
|---|---|
| private boolean useGlobalResources | |
| ReactorResourceFactory | back to summary |
|---|---|
| public ReactorResourceFactory() | |
| addGlobalResourcesConsumer | back to summary |
|---|---|
| public void addGlobalResourcesConsumer(Consumer<HttpResources> consumer) Add a Consumer for configuring the global Reactor Netty resources on
startup. When this option is used,
| |
| afterPropertiesSet | back to summary |
|---|---|
| public void afterPropertiesSet() Implements org. Doc from org. Invoked by the containing This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
| |
| destroy | back to summary |
|---|---|
| public void destroy() Implements org. Doc from org. Invoked by the containing
| |
| getConnectionProvider | back to summary |
|---|---|
| public ConnectionProvider getConnectionProvider() Return the configured | |
| getLoopResources | back to summary |
|---|---|
| public LoopResources getLoopResources() Return the configured | |
| isRunning | back to summary |
|---|---|
| public boolean isRunning() Implements org. Doc from org. Check whether this component is currently running. In the case of a container, this will return
| |
| isUseGlobalResources | back to summary |
|---|---|
| public boolean isUseGlobalResources() Whether this factory exposes the global
| |
| setConnectionProvider | back to summary |
|---|---|
| public void setConnectionProvider(ConnectionProvider connectionProvider) Use this when you want to provide an externally managed
| |
| setConnectionProviderSupplier | back to summary |
|---|---|
| public void setConnectionProviderSupplier(Supplier<ConnectionProvider> supplier) Use this when you don't want to participate in global resources and
you want to customize the creation of the managed By default, Note that this option is ignored if
| |
| setLoopResources | back to summary |
|---|---|
| public void setLoopResources(LoopResources loopResources) Use this option when you want to provide an externally managed
| |
| setLoopResourcesSupplier | back to summary |
|---|---|
| public void setLoopResourcesSupplier(Supplier<LoopResources> supplier) Use this when you don't want to participate in global resources and
you want to customize the creation of the managed By default, Note that this option is ignored if
| |
| setShutdownQuietPeriod | back to summary |
|---|---|
| public void setShutdownQuietPeriod(Duration shutdownQuietPeriod) Configure the amount of time we'll wait before shutting down resources.
If a task is submitted during the By default, this is set to
| |
| setShutdownTimeout | back to summary |
|---|---|
| public void setShutdownTimeout(Duration shutdownTimeout) Configure the maximum amount of time to wait until the disposal of the
underlying resources regardless if a task was submitted during the
By default, this is set to
| |
| setUseGlobalResources | back to summary |
|---|---|
| public void setUseGlobalResources(boolean useGlobalResources) Whether to use global Reactor Netty resources via Default is "true" in which case this factory initializes and stops the
global Reactor Netty resources within Spring's
| |
| start | back to summary |
|---|---|
| public void start() Implements org. Doc from org. Start this component. Should not throw an exception if the component is already running. In the case of a container, this will propagate the start signal to all components that apply.
| |
| stop | back to summary |
|---|---|
| public void stop() Implements org. Doc from org. Stop this component, typically in a synchronous fashion, such that the component is
fully stopped upon return of this method. Consider implementing Note that this stop notification is not guaranteed to come before destruction:
On regular shutdown, Should not throw an exception if the component is not running (not started yet). In the case of a container, this will propagate the stop signal to all components that apply.
| |