public class JettyWebSocketClient extends java.lang.Object implements WebSocketClient, SmartLifecycle
Modifier and Type | Field and Description |
---|---|
private boolean |
autoStartup |
private org.eclipse.jetty.websocket.client.WebSocketClient |
client |
private java.lang.Object |
lifecycleMonitor |
private static Log |
logger |
private int |
phase |
Constructor and Description |
---|
JettyWebSocketClient() |
Modifier and Type | Method and Description |
---|---|
WebSocketSession |
doHandshake(WebSocketHandler webSocketHandler,
HttpHeaders headers,
java.net.URI uri) |
WebSocketSession |
doHandshake(WebSocketHandler webSocketHandler,
java.lang.String uriTemplate,
java.lang.Object... uriVariables) |
int |
getPhase()
Return the phase value of this object.
|
boolean |
isAutoStartup()
Return whether this Lifecycle component should be started automatically
by the container when the ApplicationContext is refreshed.
|
boolean |
isRunning()
Check whether this component is currently running.
|
void |
setAutoStartup(boolean autoStartup) |
void |
setPhase(int phase) |
void |
start()
Start this component.
|
void |
stop()
Stop this component, typically in a synchronous fashion, such that
the component is fully stopped upon return of this method.
|
void |
stop(java.lang.Runnable callback)
Indicates that a Lifecycle component must stop if it is currently running.
|
private static final Log logger
private final org.eclipse.jetty.websocket.client.WebSocketClient client
private boolean autoStartup
private int phase
private final java.lang.Object lifecycleMonitor
public void setAutoStartup(boolean autoStartup)
public boolean isAutoStartup()
SmartLifecycle
isAutoStartup
in interface SmartLifecycle
public void setPhase(int phase)
public int getPhase()
Phased
public boolean isRunning()
Lifecycle
In the case of a container, this will return true
only if all components that apply are currently running.
public void start()
Lifecycle
In the case of a container, this will propagate the start signal to all components that apply.
public void stop()
Lifecycle
SmartLifecycle
and its stop(Runnable)
variant in cases where asynchronous stop behavior is necessary.
Should not throw an exception if the component isn't started yet.
In the case of a container, this will propagate the stop signal to all components that apply.
stop
in interface Lifecycle
SmartLifecycle.stop(Runnable)
public void stop(java.lang.Runnable callback)
SmartLifecycle
The provided callback is used by the LifecycleProcessor
to support an
ordered, and potentially concurrent, shutdown of all components having a
common shutdown order value. The callback must be executed after
the SmartLifecycle component does indeed stop.
The LifecycleProcessor
will call only this variant of the
stop
method; i.e. Lifecycle.stop()
will not be called for
SmartLifecycle
implementations unless explicitly delegated to within
this method.
stop
in interface SmartLifecycle
public WebSocketSession doHandshake(WebSocketHandler webSocketHandler, java.lang.String uriTemplate, java.lang.Object... uriVariables) throws WebSocketConnectFailureException
doHandshake
in interface WebSocketClient
WebSocketConnectFailureException
public WebSocketSession doHandshake(WebSocketHandler webSocketHandler, HttpHeaders headers, java.net.URI uri) throws WebSocketConnectFailureException
doHandshake
in interface WebSocketClient
WebSocketConnectFailureException