public abstract class ConnectionManagerSupport extends Object implements org.springframework.context.SmartLifecycle
start() and disconnects on stop().
If setAutoStartup(boolean) is set to true this will be done
automatically when the Spring ApplicationContext is refreshed.| Constructor and Description |
|---|
ConnectionManagerSupport(String uriTemplate,
Object... uriVariables) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
closeConnection()
Subclasses implement this to close the connection.
|
int |
getPhase()
Return the phase in which this endpoint connection factory will be auto-connected
and stopped.
|
protected URI |
getUri() |
boolean |
isAutoStartup()
Return the value for the 'autoStartup' property.
|
abstract boolean |
isConnected()
Whether the connection is open/
true or closed/false. |
boolean |
isRunning()
Return whether this ConnectionManager has been started.
|
protected abstract void |
openConnection()
Subclasses implement this to actually establish the connection.
|
void |
setAutoStartup(boolean autoStartup)
Set whether to auto-connect to the remote endpoint after this connection manager
has been initialized and the Spring context has been refreshed.
|
void |
setPhase(int phase)
Specify the phase in which a connection should be established to the remote
endpoint and subsequently closed.
|
void |
start()
Start the WebSocket connection.
|
protected void |
startInternal() |
void |
stop() |
void |
stop(Runnable callback) |
protected void |
stopInternal() |
protected final Log logger
protected URI getUri()
public void setAutoStartup(boolean autoStartup)
Default is "false".
public boolean isAutoStartup()
isAutoStartup in interface org.springframework.context.SmartLifecyclepublic void setPhase(int phase)
public int getPhase()
getPhase in interface org.springframework.context.PhasedgetPhase in interface org.springframework.context.SmartLifecyclepublic final void start()
start in interface org.springframework.context.Lifecycleprotected void startInternal()
public final void stop()
stop in interface org.springframework.context.Lifecyclepublic final void stop(Runnable callback)
stop in interface org.springframework.context.SmartLifecyclepublic boolean isRunning()
isRunning in interface org.springframework.context.Lifecyclepublic abstract boolean isConnected()
true or closed/false.protected abstract void openConnection()