类 EndpointConnectionManager
- java.lang.Object
- org.springframework.web.socket.client.ConnectionManagerSupport
- org.springframework.web.socket.client.standard.EndpointConnectionManager
- 所有已实现的接口:
Aware,BeanFactoryAware,Lifecycle,Phased,SmartLifecycle
public class EndpointConnectionManager extends ConnectionManagerSupport implements BeanFactoryAware
A WebSocket connection manager that is given a URI, anEndpoint, connects to a WebSocket server through theConnectionManagerSupport.start()andConnectionManagerSupport.stop()methods. IfConnectionManagerSupport.setAutoStartup(boolean)is set totruethis will be done automatically when the Spring ApplicationContext is refreshed.- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev
- 另请参阅:
AnnotatedEndpointConnectionManager
字段概要
从类继承的字段 org.springframework.web.socket.client.ConnectionManagerSupport
logger
构造器概要
构造器 构造器 说明 EndpointConnectionManager(Class<? extends Endpoint> endpointClass, String uriTemplate, Object... uriVars)EndpointConnectionManager(Endpoint endpoint, String uriTemplate, Object... uriVariables)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected voidcloseConnection()TaskExecutorgetTaskExecutor()Return the configuredTaskExecutor.WebSocketContainergetWebSocketContainer()protected booleanisConnected()protected voidopenConnection()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)从类继承的方法 org.springframework.web.socket.client.ConnectionManagerSupport
getPhase, getUri, isAutoStartup, isRunning, setAutoStartup, setPhase, start, startInternal, stop, stop, stopInternal
构造器详细资料
EndpointConnectionManager
public EndpointConnectionManager(Endpoint endpoint, String uriTemplate, Object... uriVariables)
EndpointConnectionManager
public EndpointConnectionManager(Class<? extends Endpoint> endpointClass, String uriTemplate, Object... uriVars)
方法详细资料
setSupportedProtocols
public void setSupportedProtocols(String... protocols)
setExtensions
public void setExtensions(Extension... extensions)
setEncoders
public void setEncoders(List<Class<? extends Encoder>> encoders)
setDecoders
public void setDecoders(List<Class<? extends Decoder>> decoders)
setConfigurator
public void setConfigurator(ClientEndpointConfig.Configurator configurator)
setWebSocketContainer
public void setWebSocketContainer(WebSocketContainer webSocketContainer)
getWebSocketContainer
public WebSocketContainer getWebSocketContainer()
setBeanFactory
public void setBeanFactory(BeanFactory beanFactory)
从接口复制的说明: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.- 指定者:
setBeanFactory在接口中BeanFactoryAware- 参数:
beanFactory- owning BeanFactory (nevernull). The bean can immediately call methods on the factory.- 另请参阅:
BeanInitializationException
setTaskExecutor
public void setTaskExecutor(TaskExecutor taskExecutor)
Set aTaskExecutorto use to open connections. By defaultSimpleAsyncTaskExecutoris 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