Class EndpointConnectionManager
java.lang.Object
org.springframework.web.socket.client.ConnectionManagerSupport
org.springframework.web.socket.client.standard.EndpointConnectionManager
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle
public class EndpointConnectionManager
extends ConnectionManagerSupport
implements org.springframework.beans.factory.BeanFactoryAware
A WebSocket connection manager that is given a URI, an
Endpoint, connects to a
WebSocket server through the ConnectionManagerSupport.start() and ConnectionManagerSupport.stop() methods. If
ConnectionManagerSupport.setAutoStartup(boolean) is set to true this will be done automatically
when the Spring ApplicationContext is refreshed.- Since:
- 4.0
- Author:
- Rossen Stoyanchev
- See Also:
-
Field Summary
Fields inherited from class org.springframework.web.socket.client.ConnectionManagerSupport
loggerFields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
ConstructorsConstructorDescriptionEndpointConnectionManager(Endpoint endpoint, String uriTemplate, Object... uriVariables) EndpointConnectionManager(Class<? extends Endpoint> endpointClass, String uriTemplate, Object... uriVars) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidorg.springframework.core.task.TaskExecutorReturn the configuredTaskExecutor.protected booleanprotected voidvoidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) voidsetConfigurator(ClientEndpointConfig.Configurator configurator) voidsetDecoders(List<Class<? extends Decoder>> decoders) voidsetEncoders(List<Class<? extends Encoder>> encoders) voidsetExtensions(Extension... extensions) voidsetSupportedProtocols(String... protocols) voidsetTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor) Set aTaskExecutorto use to open connections.voidsetWebSocketContainer(WebSocketContainer webSocketContainer) Methods inherited from class org.springframework.web.socket.client.ConnectionManagerSupport
getPhase, getUri, isAutoStartup, isRunning, setAutoStartup, setPhase, start, startInternal, stop, stop, stopInternal
-
Constructor Details
-
EndpointConnectionManager
-
EndpointConnectionManager
-
-
Method Details
-
setSupportedProtocols
-
setExtensions
-
setEncoders
-
setDecoders
-
setConfigurator
-
setWebSocketContainer
-
getWebSocketContainer
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) - Specified by:
setBeanFactoryin interfaceorg.springframework.beans.factory.BeanFactoryAware
-
setTaskExecutor
public void setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor) Set aTaskExecutorto use to open connections. By defaultSimpleAsyncTaskExecutoris used. -
getTaskExecutor
public org.springframework.core.task.TaskExecutor getTaskExecutor()Return the configuredTaskExecutor. -
openConnection
protected void openConnection()- Specified by:
openConnectionin classConnectionManagerSupport
-
closeConnection
- Specified by:
closeConnectionin classConnectionManagerSupport- Throws:
Exception
-
isConnected
protected boolean isConnected()- Specified by:
isConnectedin classConnectionManagerSupport
-