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 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 voidSubclasses implement this to close the connection.Return the configuredTaskExecutor.booleanWhether 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(ClientEndpointConfig.Configurator configurator) voidsetDecoders(List<Class<? extends Decoder>> decoders) voidsetEncoders(List<Class<? extends Encoder>> encoders) voidsetExtensions(Extension... extensions) voidsetSupportedProtocols(String... protocols) voidsetTaskExecutor(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
Description 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 interfaceBeanFactoryAware- Parameters:
beanFactory- owning BeanFactory (nevernull). The bean can immediately call methods on the factory.- See Also:
-
setTaskExecutor
Set aTaskExecutorto use to open connections. By defaultSimpleAsyncTaskExecutoris used. -
getTaskExecutor
Return the configuredTaskExecutor. -
isConnected
public boolean isConnected()Description copied from class:ConnectionManagerSupportWhether the connection is open/trueor closed/false.- Specified by:
isConnectedin classConnectionManagerSupport
-
openConnection
protected void openConnection()Description copied from class:ConnectionManagerSupportSubclasses implement this to actually establish the connection.- Specified by:
openConnectionin classConnectionManagerSupport
-
closeConnection
Description copied from class:ConnectionManagerSupportSubclasses implement this to close the connection.- Specified by:
closeConnectionin classConnectionManagerSupport- Throws:
Exception
-