org.springframework.web.socket.client.standard

## Class AnnotatedEndpointConnectionManager

- java.lang.Object
- - org.springframework.web.socket.client.ConnectionManagerSupport
  - - org.springframework.web.socket.client.standard.AnnotatedEndpointConnectionManager

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 AnnotatedEndpointConnectionManager
    extends ConnectionManagerSupport
    implements org.springframework.beans.factory.BeanFactoryAware

A WebSocket connection manager that is given a URI, a `ClientEndpoint`-annotated 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

### 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

Constructors
Constructor and Description
`AnnotatedEndpointConnectionManager(Class<?> endpointClass, String uriTemplate, Object... uriVariables)`
`AnnotatedEndpointConnectionManager(Object endpoint, String uriTemplate, Object... uriVariables)`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected void` `closeConnection()`
`org.springframework.core.task.TaskExecutor` `getTaskExecutor()` Return the configured `TaskExecutor`.
`WebSocketContainer` `getWebSocketContainer()`
`protected boolean` `isConnected()`
`protected void` `openConnection()`
`void` `setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)`
`void` `setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)` Set a `TaskExecutor` to use to open the connection.
`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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### AnnotatedEndpointConnectionManager

    public AnnotatedEndpointConnectionManager(Object endpoint,
                                              String uriTemplate,
                                              Object... uriVariables)

#### AnnotatedEndpointConnectionManager

    public AnnotatedEndpointConnectionManager(Class<?> endpointClass,
                                              String uriTemplate,
                                              Object... uriVariables)

### Method Detail

#### setWebSocketContainer

    public void setWebSocketContainer(WebSocketContainer webSocketContainer)

#### getWebSocketContainer

    public WebSocketContainer getWebSocketContainer()

#### setBeanFactory

    public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
                        throws org.springframework.beans.BeansException

Specified by:
  `setBeanFactory` in interface `org.springframework.beans.factory.BeanFactoryAware`
Throws:
  `org.springframework.beans.BeansException`

#### setTaskExecutor

    public void setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)

Set a `TaskExecutor` to use to open the connection. By default `SimpleAsyncTaskExecutor` is used.

#### getTaskExecutor

    public org.springframework.core.task.TaskExecutor getTaskExecutor()

Return the configured `TaskExecutor`.

#### openConnection

    protected void openConnection()

Specified by:
  `openConnection` in class `ConnectionManagerSupport`

#### closeConnection

    protected void closeConnection()
                            throws Exception

Specified by:
  `closeConnection` in class `ConnectionManagerSupport`
Throws:
  `Exception`

#### isConnected

    protected boolean isConnected()

Specified by:
  `isConnected` in class `ConnectionManagerSupport`