public class EndpointConnectionManager extends ConnectionManagerSupport implements BeanFactoryAware
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.AnnotatedEndpointConnectionManager
logger
Constructor and Description |
---|
EndpointConnectionManager(java.lang.Class<? extends javax.websocket.Endpoint> endpointClass,
java.lang.String uriTemplate,
java.lang.Object... uriVars) |
EndpointConnectionManager(javax.websocket.Endpoint endpoint,
java.lang.String uriTemplate,
java.lang.Object... uriVariables) |
Modifier and Type | Method and Description |
---|---|
protected void |
closeConnection() |
TaskExecutor |
getTaskExecutor()
Return the configured
TaskExecutor . |
javax.websocket.WebSocketContainer |
getWebSocketContainer() |
protected boolean |
isConnected() |
protected void |
openConnection() |
void |
setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.
|
void |
setConfigurator(javax.websocket.ClientEndpointConfig.Configurator configurator) |
void |
setDecoders(java.util.List<java.lang.Class<? extends javax.websocket.Decoder>> decoders) |
void |
setEncoders(java.util.List<java.lang.Class<? extends javax.websocket.Encoder>> encoders) |
void |
setExtensions(javax.websocket.Extension... extensions) |
void |
setSupportedProtocols(java.lang.String... protocols) |
void |
setTaskExecutor(TaskExecutor taskExecutor)
Set a
TaskExecutor to use to open connections. |
void |
setWebSocketContainer(javax.websocket.WebSocketContainer webSocketContainer) |
getPhase, getUri, isAutoStartup, isRunning, setAutoStartup, setPhase, start, startInternal, stop, stop, stopInternal
public EndpointConnectionManager(javax.websocket.Endpoint endpoint, java.lang.String uriTemplate, java.lang.Object... uriVariables)
public EndpointConnectionManager(java.lang.Class<? extends javax.websocket.Endpoint> endpointClass, java.lang.String uriTemplate, java.lang.Object... uriVars)
public void setSupportedProtocols(java.lang.String... protocols)
public void setExtensions(javax.websocket.Extension... extensions)
public void setEncoders(java.util.List<java.lang.Class<? extends javax.websocket.Encoder>> encoders)
public void setDecoders(java.util.List<java.lang.Class<? extends javax.websocket.Decoder>> decoders)
public void setConfigurator(javax.websocket.ClientEndpointConfig.Configurator configurator)
public void setWebSocketContainer(javax.websocket.WebSocketContainer webSocketContainer)
public javax.websocket.WebSocketContainer getWebSocketContainer()
public void setBeanFactory(BeanFactory beanFactory)
BeanFactoryAware
Invoked after the population of normal bean properties
but before an initialization callback such as
InitializingBean.afterPropertiesSet()
or a custom init-method.
setBeanFactory
in interface BeanFactoryAware
beanFactory
- owning BeanFactory (never null
).
The bean can immediately call methods on the factory.BeanInitializationException
public void setTaskExecutor(TaskExecutor taskExecutor)
TaskExecutor
to use to open connections.
By default SimpleAsyncTaskExecutor
is used.public TaskExecutor getTaskExecutor()
TaskExecutor
.protected void openConnection()
openConnection
in class ConnectionManagerSupport
protected void closeConnection() throws java.lang.Exception
closeConnection
in class ConnectionManagerSupport
java.lang.Exception
protected boolean isConnected()
isConnected
in class ConnectionManagerSupport