Package org.htmlunit.websocket
Class JettyWebSocketAdapter
- java.lang.Object
-
- org.htmlunit.websocket.JettyWebSocketAdapter
-
- All Implemented Interfaces:
WebSocketAdapter
public abstract class JettyWebSocketAdapter extends java.lang.Object implements WebSocketAdapter
Jetty based impl of the WebSocketAdapter.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
JettyWebSocketAdapter.JettyWebSocketAdapterImpl
-
Field Summary
Fields Modifier and Type Field Description private org.eclipse.jetty.websocket.client.WebSocketClient
client_
private java.lang.Object
clientLock_
private org.eclipse.jetty.websocket.api.Session
incomingSession_
private org.eclipse.jetty.websocket.api.Session
outgoingSession_
-
Constructor Summary
Constructors Constructor Description JettyWebSocketAdapter(WebClient webClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeClient()
void
closeIncommingSession()
void
closeOutgoingSession()
void
connect(java.net.URI url)
void
send(java.lang.Object content)
void
start()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.htmlunit.websocket.WebSocketAdapter
onWebSocketBinary, onWebSocketClose, onWebSocketConnect, onWebSocketConnectError, onWebSocketConnecting, onWebSocketError, onWebSocketText
-
-
-
-
Field Detail
-
clientLock_
private final java.lang.Object clientLock_
-
client_
private org.eclipse.jetty.websocket.client.WebSocketClient client_
-
incomingSession_
private volatile org.eclipse.jetty.websocket.api.Session incomingSession_
-
outgoingSession_
private org.eclipse.jetty.websocket.api.Session outgoingSession_
-
-
Constructor Detail
-
JettyWebSocketAdapter
public JettyWebSocketAdapter(WebClient webClient)
-
-
Method Detail
-
start
public void start() throws java.lang.Exception
- Specified by:
start
in interfaceWebSocketAdapter
- Throws:
java.lang.Exception
-
connect
public void connect(java.net.URI url) throws java.lang.Exception
- Specified by:
connect
in interfaceWebSocketAdapter
- Throws:
java.lang.Exception
-
send
public void send(java.lang.Object content) throws java.io.IOException
- Specified by:
send
in interfaceWebSocketAdapter
- Throws:
java.io.IOException
-
closeIncommingSession
public void closeIncommingSession()
- Specified by:
closeIncommingSession
in interfaceWebSocketAdapter
-
closeOutgoingSession
public void closeOutgoingSession()
- Specified by:
closeOutgoingSession
in interfaceWebSocketAdapter
-
closeClient
public void closeClient() throws java.lang.Exception
- Specified by:
closeClient
in interfaceWebSocketAdapter
- Throws:
java.lang.Exception
-
-