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
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 Summary
Fields inherited from class org.springframework.web.socket.client.ConnectionManagerSupport
logger
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
ConstructorDescriptionEndpointConnectionManager
(Endpoint endpoint, String uriTemplate, Object... uriVariables) EndpointConnectionManager
(Class<? extends Endpoint> endpointClass, String uriTemplate, Object... uriVars) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Subclasses implement this to close the connection.org.springframework.core.task.TaskExecutor
Return the configuredTaskExecutor
.boolean
Whether the connection is open/true
or closed/false
.protected void
Subclasses implement this to actually establish the connection.void
setBeanFactory
(org.springframework.beans.factory.BeanFactory beanFactory) void
setConfigurator
(ClientEndpointConfig.Configurator configurator) void
setDecoders
(List<Class<? extends Decoder>> decoders) void
setEncoders
(List<Class<? extends Encoder>> encoders) void
setExtensions
(Extension... extensions) void
setSupportedProtocols
(String... protocols) void
setTaskExecutor
(org.springframework.core.task.TaskExecutor taskExecutor) Set aTaskExecutor
to use to open connections.void
setWebSocketContainer
(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:
setBeanFactory
in interfaceorg.springframework.beans.factory.BeanFactoryAware
-
setTaskExecutor
public void setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor) Set aTaskExecutor
to use to open connections. By defaultSimpleAsyncTaskExecutor
is used. -
getTaskExecutor
public org.springframework.core.task.TaskExecutor getTaskExecutor()Return the configuredTaskExecutor
. -
isConnected
public boolean isConnected()Description copied from class:ConnectionManagerSupport
Whether the connection is open/true
or closed/false
.- Specified by:
isConnected
in classConnectionManagerSupport
-
openConnection
protected void openConnection()Description copied from class:ConnectionManagerSupport
Subclasses implement this to actually establish the connection.- Specified by:
openConnection
in classConnectionManagerSupport
-
closeConnection
Description copied from class:ConnectionManagerSupport
Subclasses implement this to close the connection.- Specified by:
closeConnection
in classConnectionManagerSupport
- Throws:
Exception
-