类 AnnotatedEndpointConnectionManager
- java.lang.Object
- org.springframework.web.socket.client.ConnectionManagerSupport
- org.springframework.web.socket.client.standard.AnnotatedEndpointConnectionManager
- 所有已实现的接口:
Aware
,BeanFactoryAware
,Lifecycle
,Phased
,SmartLifecycle
public class AnnotatedEndpointConnectionManager extends ConnectionManagerSupport implements BeanFactoryAware
A WebSocket connection manager that is given a URI, aClientEndpoint
-annotated endpoint, connects to a WebSocket server through theConnectionManagerSupport.start()
andConnectionManagerSupport.stop()
methods. IfConnectionManagerSupport.setAutoStartup(boolean)
is set totrue
this will be done automatically when the Spring ApplicationContext is refreshed.- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev
字段概要
从类继承的字段 org.springframework.web.socket.client.ConnectionManagerSupport
logger
从接口继承的字段 org.springframework.context.SmartLifecycle
DEFAULT_PHASE
构造器概要
构造器 构造器 说明 AnnotatedEndpointConnectionManager(Class<?> endpointClass, String uriTemplate, Object... uriVariables)
AnnotatedEndpointConnectionManager(Object endpoint, String uriTemplate, Object... uriVariables)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected void
closeConnection()
TaskExecutor
getTaskExecutor()
Return the configuredTaskExecutor
.WebSocketContainer
getWebSocketContainer()
protected boolean
isConnected()
protected void
openConnection()
void
setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.void
setTaskExecutor(TaskExecutor taskExecutor)
Set aTaskExecutor
to use to open the connection.void
setWebSocketContainer(WebSocketContainer webSocketContainer)
从类继承的方法 org.springframework.web.socket.client.ConnectionManagerSupport
getPhase, getUri, isAutoStartup, isRunning, setAutoStartup, setPhase, start, startInternal, stop, stop, stopInternal
构造器详细资料
AnnotatedEndpointConnectionManager
public AnnotatedEndpointConnectionManager(Object endpoint, String uriTemplate, Object... uriVariables)
AnnotatedEndpointConnectionManager
public AnnotatedEndpointConnectionManager(Class<?> endpointClass, String uriTemplate, Object... uriVariables)
方法详细资料
setWebSocketContainer
public void setWebSocketContainer(WebSocketContainer webSocketContainer)
getWebSocketContainer
public WebSocketContainer getWebSocketContainer()
setBeanFactory
public void setBeanFactory(BeanFactory beanFactory) throws BeansException
从接口复制的说明: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.- 指定者:
setBeanFactory
在接口中BeanFactoryAware
- 参数:
beanFactory
- owning BeanFactory (nevernull
). The bean can immediately call methods on the factory.- 抛出:
BeansException
- in case of initialization errors- 另请参阅:
BeanInitializationException
setTaskExecutor
public void setTaskExecutor(TaskExecutor taskExecutor)
Set aTaskExecutor
to use to open the connection. By defaultSimpleAsyncTaskExecutor
is used.
getTaskExecutor
public TaskExecutor getTaskExecutor()
Return the configuredTaskExecutor
.
openConnection
protected void openConnection()
closeConnection
protected void closeConnection() throws Exception
- 指定者:
closeConnection
在类中ConnectionManagerSupport
- 抛出:
Exception
isConnected
protected boolean isConnected()
- 指定者:
isConnected
在类中ConnectionManagerSupport