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
WebSocket connection manager that connects to the server via WebSocketContainer and handles the session with an @ClientEndpoint endpoint.
Since:
4.0
Author:
Rossen Stoyanchev
  • Constructor Details

    • AnnotatedEndpointConnectionManager

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

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

    • 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.
    • isConnected

      public boolean isConnected()
      Description copied from class: ConnectionManagerSupport
      Whether the connection is open/true or closed/false.
      Specified by:
      isConnected in class ConnectionManagerSupport
    • openConnection

      protected void openConnection()
      Description copied from class: ConnectionManagerSupport
      Subclasses implement this to actually establish the connection.
      Specified by:
      openConnection in class ConnectionManagerSupport
    • closeConnection

      protected void closeConnection() throws Exception
      Description copied from class: ConnectionManagerSupport
      Subclasses implement this to close the connection.
      Specified by:
      closeConnection in class ConnectionManagerSupport
      Throws:
      Exception