|
Oracle Fusion Middleware Java API Reference for Oracle WebLogic Server 12c (12.1.3) Part Number E41849-02 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@Deprecated public interface WebSocketListener
This interface is used to handle WebSocket messages. The lifecycle of its instance is managed by the container. All of the methods on this interface are callback methods. The container will call various methods during the lifetime of the WebSocket.
A WebSocketListener may use any of the resource injection functionality described in Chapter EE.5 of the Java EE Platform specification, "Resource, Naming and Injection".
WebSocket
Method Summary | |
---|---|
boolean |
accept(WSHandshakeRequest request,
WSHandshakeResponse response)
Deprecated. This method is called before upgrading the HTTP connection to a WebSocket connection. |
void |
destroy()
Deprecated. This method is called before the application is undeployed. |
void |
init(WebSocketContext context)
Deprecated. This method is called after the instance of this interface is created. |
void |
onClose(WebSocketConnection connection,
ClosingMessage message)
Deprecated. This method is called when the WebSocket is closed by the WebSocket client. |
void |
onError(WebSocketConnection connection,
Throwable error)
Deprecated. This method is called if the container encounters difficulty. |
void |
onFragment(WebSocketConnection connection,
boolean last,
byte[] payload)
Deprecated. This method is called when a CONTINUATION data frame containing binary payload is received. |
void |
onFragment(WebSocketConnection connection,
boolean last,
String payload)
Deprecated. This method is called when a CONTINUATION data frame containing text payload is received. |
void |
onMessage(WebSocketConnection connection,
byte[] payload)
Deprecated. This method is called when a BINARY data frame is received. |
void |
onMessage(WebSocketConnection connection,
String payload)
Deprecated. This method is called when a TEXT data frame is received. |
void |
onOpen(WebSocketConnection connection)
Deprecated. This method is called after the WebSocket opening handshake succeeds and the connection is established. |
void |
onPing(WebSocketConnection connection,
byte[] payload)
Deprecated. This method is called when a PING control frame is received. |
void |
onPong(WebSocketConnection connection,
byte[] payload)
Deprecated. This method is called when a PONG control frame is received. |
void |
onTimeout(WebSocketConnection connection)
Deprecated. This method is called when the WebSocket does not receive any message for the specified timeout period. |
Method Detail |
---|
void init(WebSocketContext context)
context
- the WebSocketContext associated with the WebSocket that
is listened on by this listener.void destroy()
boolean accept(WSHandshakeRequest request, WSHandshakeResponse response)
request
- the WebSocket opening handshake request.response
- the WebSocket opening handshake response.
void onOpen(WebSocketConnection connection)
connection
- the WebSocket connection is established.void onMessage(WebSocketConnection connection, String payload)
connection
- the WebSocket connection receiving the message.payload
- the received payload from the TEXT data frame.void onMessage(WebSocketConnection connection, byte[] payload)
connection
- the WebSocket connection receiving the message.payload
- the received payload from the BINARY data frame.void onFragment(WebSocketConnection connection, boolean last, String payload)
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.void onFragment(WebSocketConnection connection, boolean last, byte[] payload)
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.void onPing(WebSocketConnection connection, byte[] payload)
connection
- the WebSocket connection receiving the PING control frame.payload
- the received payload from the PING control frame.void onPong(WebSocketConnection connection, byte[] payload)
connection
- the WebSocket connection receiving the PONG control frame.payload
- the received payload from the PONG control frame.void onTimeout(WebSocketConnection connection)
connection
- the WebSocket connection that timed out.WebSocket
void onError(WebSocketConnection connection, Throwable error)
connection
- the WebSocket connection having difficulty.error
- the error encountered in the container.void onClose(WebSocketConnection connection, ClosingMessage message)
connection
- the WebSocket connection receiving the CLOSE control frame.message
- the close message received.
|
Copyright 1996, 2014, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Oracle Fusion Middleware Java API Reference for Oracle WebLogic Server 12c (12.1.3) Part Number E41849-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |