public abstract class ConnectionManagerSupport extends Object implements org.springframework.context.SmartLifecycle
autoStartup
property is set
to true
, or if set to false
, the start()
and #stop methods can
be invoked manually.Constructor and Description |
---|
ConnectionManagerSupport(String uriTemplate,
Object... uriVariables) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
closeConnection() |
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.
|
protected abstract boolean |
isConnected() |
boolean |
isRunning()
Return whether this ConnectionManager has been started.
|
protected abstract void |
openConnection() |
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.SmartLifecycle
public void setPhase(int phase)
public int getPhase()
getPhase
in interface org.springframework.context.Phased
public final void start()
start
in interface org.springframework.context.Lifecycle
protected void startInternal()
public final void stop()
stop
in interface org.springframework.context.Lifecycle
public final void stop(Runnable callback)
stop
in interface org.springframework.context.SmartLifecycle
public boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
protected abstract void openConnection()
protected abstract boolean isConnected()