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
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
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
Return the configuredTaskExecutor
.protected boolean
protected void
void
setBeanFactory
(BeanFactory beanFactory) Callback that supplies the owning factory to a bean instance.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
(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
Description copied from interface:BeanFactoryAware
Callback 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:
setBeanFactory
in interfaceBeanFactoryAware
- Parameters:
beanFactory
- owning BeanFactory (nevernull
). The bean can immediately call methods on the factory.- See Also:
-
setTaskExecutor
Set aTaskExecutor
to use to open connections. By defaultSimpleAsyncTaskExecutor
is used. -
getTaskExecutor
Return the configuredTaskExecutor
. -
openConnection
protected void openConnection()- Specified by:
openConnection
in classConnectionManagerSupport
-
closeConnection
- Specified by:
closeConnection
in classConnectionManagerSupport
- Throws:
Exception
-
isConnected
protected boolean isConnected()- Specified by:
isConnected
in classConnectionManagerSupport
-