WebSocketListener
@Deprecated public class WebSocketAdapter extends java.lang.Object implements WebSocketListener
WebSocketListener
interface. Almost all of the callback methods are implemented as empty methods in this
class. Applications can extend this class to override callback methods they
care about.WebSocketListener
Modifier and Type | Method | Description |
---|---|---|
boolean |
accept(WSHandshakeRequest request,
WSHandshakeResponse response) |
Deprecated.
This method always return true.
|
void |
destroy() |
Deprecated.
Do nothing.
|
protected WebSocketContext |
getWebSocketContext() |
Deprecated.
Get a
WebSocketContext instance associated with this
WebSocketAdapter . |
void |
init(WebSocketContext context) |
Deprecated.
This method is called after the instance of this interface is created.
|
void |
onClose(WebSocketConnection connection,
ClosingMessage msg) |
Deprecated.
Empty implementation for this callback method.
|
void |
onError(WebSocketConnection connection,
java.lang.Throwable error) |
Deprecated.
Empty implementation for this callback method.
|
void |
onFragment(WebSocketConnection connection,
boolean last,
byte[] payload) |
Deprecated.
Empty implementation for this callback method.
|
void |
onFragment(WebSocketConnection connection,
boolean last,
java.lang.String payload) |
Deprecated.
Empty implementation for this callback method.
|
void |
onMessage(WebSocketConnection connection,
byte[] payload) |
Deprecated.
Empty implementation for this callback method.
|
void |
onMessage(WebSocketConnection connection,
java.lang.String payload) |
Deprecated.
Empty implementation for this callback method.
|
void |
onOpen(WebSocketConnection connection) |
Deprecated.
Empty implementation for this callback method.
|
void |
onPing(WebSocketConnection connection,
byte[] payload) |
Deprecated.
Empty implementation for this callback method.
|
void |
onPong(WebSocketConnection connection,
byte[] payload) |
Deprecated.
Empty implementation for this callback method.
|
void |
onTimeout(WebSocketConnection connection) |
Deprecated.
Empty implementation for this callback method.
|
protected WebSocketContext getWebSocketContext()
WebSocketContext
instance associated with this
WebSocketAdapter
.public void init(WebSocketContext context)
WebSocketListener
init
in interface WebSocketListener
context
- the WebSocketContext associated with the WebSocket that
is listened on by this listener.WebSocketListener.init(weblogic.websocket.WebSocketContext)
public void destroy()
destroy
in interface WebSocketListener
WebSocketListener.destroy()
public boolean accept(WSHandshakeRequest request, WSHandshakeResponse response)
accept
in interface WebSocketListener
request
- the WebSocket opening handshake request.response
- the WebSocket opening handshake response.WebSocketListener.accept(WSHandshakeRequest, WSHandshakeResponse)
public void onOpen(WebSocketConnection connection)
onOpen
in interface WebSocketListener
connection
- the WebSocket connection is established.WebSocketListener.onOpen(weblogic.websocket.WebSocketConnection)
public void onMessage(WebSocketConnection connection, java.lang.String payload)
onMessage
in interface WebSocketListener
connection
- the WebSocket connection receiving the message.payload
- the received payload from the TEXT data frame.WebSocketListener.onMessage(WebSocketConnection, String)
public void onMessage(WebSocketConnection connection, byte[] payload)
onMessage
in interface WebSocketListener
connection
- the WebSocket connection receiving the message.payload
- the received payload from the BINARY data frame.WebSocketListener.onMessage(WebSocketConnection, byte[])
public void onFragment(WebSocketConnection connection, boolean last, java.lang.String payload)
onFragment
in interface WebSocketListener
connection
- the WebSocket connection receiving the message.last
- indicates if this is the last fragment to be received.payload
- the received text payload from the CONTINUATION data frame.WebSocketListener.onFragment(WebSocketConnection, boolean, String)
public void onFragment(WebSocketConnection connection, boolean last, byte[] payload)
onFragment
in interface WebSocketListener
connection
- the WebSocket connection receiving the message.last
- indicates if this is the last fragment to be received.payload
- the received binary payload from the CONTINUATION data
frame.WebSocketListener.onFragment(WebSocketConnection, boolean, byte[])
public void onPing(WebSocketConnection connection, byte[] payload)
onPing
in interface WebSocketListener
connection
- the WebSocket connection receiving the PING control frame.payload
- the received payload from the PING control frame.WebSocketListener.onPing(WebSocketConnection, byte[])
public void onPong(WebSocketConnection connection, byte[] payload)
onPong
in interface WebSocketListener
connection
- the WebSocket connection receiving the PONG control frame.payload
- the received payload from the PONG control frame.WebSocketListener.onPong(WebSocketConnection, byte[])
public void onTimeout(WebSocketConnection connection)
onTimeout
in interface WebSocketListener
connection
- the WebSocket connection that timed out.WebSocketListener.onTimeout(weblogic.websocket.WebSocketConnection)
public void onError(WebSocketConnection connection, java.lang.Throwable error)
onError
in interface WebSocketListener
connection
- the WebSocket connection having difficulty.error
- the error encountered in the container.WebSocketListener.onError(WebSocketConnection, Throwable)
public void onClose(WebSocketConnection connection, ClosingMessage msg)
onClose
in interface WebSocketListener
connection
- the WebSocket connection receiving the CLOSE control frame.msg
- the close message received.WebSocketListener.onClose(WebSocketConnection, ClosingMessage)