public abstract class ConnectionManagerSupport
A base class for WebSocket connection managers. Provides a declarative style of
connecting to a WebSocket server given a URI to connect to. The connection occurs when
the Spring ApplicationContext is refreshed, if the autoStartup property is set
to true, or if set to false, the start() and #stop methods can
be invoked manually.
Specify the phase in which a connection should be established to the remote
endpoint and subsequently closed. The startup order proceeds from lowest to
highest, and the shutdown order is the reverse of that. By default this value is
Integer.MAX_VALUE meaning that this endpoint connection factory connects as late as
possible and is closed as soon as possible.
public int getPhase()
Return the phase in which this endpoint connection factory will be auto-connected
Stop this component, typically in a synchronous fashion, such that the component is
fully stopped upon return of this method. Consider implementing SmartLifecycle
and its stop(Runnable) variant when asynchronous stop behavior is necessary.
Note that this stop notification is not guaranteed to come before destruction:
On regular shutdown, Lifecycle beans will first receive a stop notification
before the general destruction callbacks are being propagated; however, on hot
refresh during a context's lifetime or on aborted refresh attempts, a given bean's
destroy method will be called without any consideration of stop signals upfront.
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
Indicates that a Lifecycle component must stop if it is currently running.
The provided callback is used by the LifecycleProcessor to support
an ordered, and potentially concurrent, shutdown of all components having a
common shutdown order value. The callback must be executed after
the SmartLifecycle component does indeed stop.
The LifecycleProcessor will call only this variant of the
stop method; i.e. Lifecycle.stop() will not be called for
SmartLifecycle implementations unless explicitly delegated to within
the implementation of this method.
The default implementation delegates to Lifecycle.stop() and immediately
triggers the given callback in the calling thread. Note that there is no
synchronization between the two, so custom implementations may at least
want to put the same steps within their common lifecycle monitor (if any).