Class EndpointConnectionManager
java.lang.Object
org.springframework.web.socket.client.ConnectionManagerSupport
org.springframework.web.socket.client.standard.EndpointConnectionManager
- All Implemented Interfaces:
- Aware, BeanFactoryAware, Lifecycle, Phased, SmartLifecycle
WebSocket 
connection manager that connects
to the server via WebSocketContainer and handles the session with an
Endpoint.- Since:
- 4.0
- Author:
- Rossen Stoyanchev
- See Also:
- 
Field SummaryFields inherited from class ConnectionManagerSupportloggerFields inherited from interface SmartLifecycleDEFAULT_PHASE
- 
Constructor SummaryConstructorsConstructorDescriptionEndpointConnectionManager(jakarta.websocket.Endpoint endpoint, String uriTemplate, @Nullable Object... uriVariables) EndpointConnectionManager(Class<? extends jakarta.websocket.Endpoint> endpointClass, String uriTemplate, @Nullable Object... uriVars) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidSubclasses implement this to close the connection.Return the configuredTaskExecutor.jakarta.websocket.WebSocketContainerbooleanWhether the connection is open/trueor closed/false.protected voidSubclasses implement this to actually establish the connection.voidsetBeanFactory(BeanFactory beanFactory) Callback that supplies the owning factory to a bean instance.voidsetConfigurator(jakarta.websocket.ClientEndpointConfig.Configurator configurator) voidsetDecoders(List<Class<? extends jakarta.websocket.Decoder>> decoders) voidsetEncoders(List<Class<? extends jakarta.websocket.Encoder>> encoders) voidsetExtensions(jakarta.websocket.Extension... extensions) voidsetSupportedProtocols(String... protocols) voidsetTaskExecutor(TaskExecutor taskExecutor) Set aTaskExecutorto use to open connections.voidsetWebSocketContainer(jakarta.websocket.WebSocketContainer webSocketContainer) Methods inherited from class ConnectionManagerSupportgetPhase, getUri, isAutoStartup, isRunning, setAutoStartup, setPhase, start, startInternal, stop, stop, stopInternalMethods inherited from class Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface SmartLifecycleisPauseable
- 
Constructor Details- 
EndpointConnectionManager
- 
EndpointConnectionManager
 
- 
- 
Method Details- 
setSupportedProtocols
- 
setExtensionspublic void setExtensions(jakarta.websocket.Extension... extensions) 
- 
setEncoders
- 
setDecoders
- 
setConfiguratorpublic void setConfigurator(jakarta.websocket.ClientEndpointConfig.Configurator configurator) 
- 
setWebSocketContainerpublic void setWebSocketContainer(jakarta.websocket.WebSocketContainer webSocketContainer) 
- 
getWebSocketContainerpublic jakarta.websocket.WebSocketContainer getWebSocketContainer()
- 
setBeanFactoryDescription copied from interface:BeanFactoryAwareCallback that supplies the owning factory to a bean instance.Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean.afterPropertiesSet()or a custom init-method.- Specified by:
- setBeanFactoryin interface- BeanFactoryAware
- Parameters:
- beanFactory- owning BeanFactory (never- null). The bean can immediately call methods on the factory.
- See Also:
 
- 
setTaskExecutorSet aTaskExecutorto use to open connections. By defaultSimpleAsyncTaskExecutoris used.
- 
getTaskExecutorReturn the configuredTaskExecutor.
- 
isConnectedpublic boolean isConnected()Description copied from class:ConnectionManagerSupportWhether the connection is open/trueor closed/false.- Specified by:
- isConnectedin class- ConnectionManagerSupport
 
- 
openConnectionprotected void openConnection()Description copied from class:ConnectionManagerSupportSubclasses implement this to actually establish the connection.- Specified by:
- openConnectionin class- ConnectionManagerSupport
 
- 
closeConnectionDescription copied from class:ConnectionManagerSupportSubclasses implement this to close the connection.- Specified by:
- closeConnectionin class- ConnectionManagerSupport
- Throws:
- Exception
 
 
-