|
Oracle Fusion Middleware Java API Reference for Oracle WebLogic Server 12c (12.2.1) Part Number E55141-01 P4 Change 1723563 on 2015/10/09 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Deprecated. As of release 12.1.3, replaced by JSR356: Java API for WebSocket
@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 | |
---|---|
abstract boolean |
accept(WSHandshakeRequest request, WSHandshakeResponse response) Deprecated. This method is called before upgrading the HTTP connection to a WebSocket connection. |
abstract void |
destroy() Deprecated. This method is called before the application is undeployed. |
abstract void |
init(WebSocketContext context) Deprecated. This method is called after the instance of this interface is created. |
abstract void |
onClose(WebSocketConnection connection, ClosingMessage message) Deprecated. This method is called when the WebSocket is closed by the WebSocket client. |
abstract void |
onError(WebSocketConnection connection, Throwable error) Deprecated. This method is called if the container encounters difficulty. |
abstract void |
onFragment(WebSocketConnection connection, boolean last, byte[] payload) Deprecated. This method is called when a CONTINUATION data frame containing binary payload is received. |
abstract void |
onFragment(WebSocketConnection connection, boolean last, String payload) Deprecated. This method is called when a CONTINUATION data frame containing text payload is received. |
abstract void |
onMessage(WebSocketConnection connection, byte[] payload) Deprecated. This method is called when a BINARY data frame is received. |
abstract void |
onMessage(WebSocketConnection connection, String payload) Deprecated. This method is called when a TEXT data frame is received. |
abstract void |
onOpen(WebSocketConnection connection) Deprecated. This method is called after the WebSocket opening handshake succeeds and the connection is established. |
abstract void |
onPing(WebSocketConnection connection, byte[] payload) Deprecated. This method is called when a PING control frame is received. |
abstract void |
onPong(WebSocketConnection connection, byte[] payload) Deprecated. This method is called when a PONG control frame is received. |
abstract 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, 2015, 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.2.1) Part Number E55141-01 P4 Change 1723563 on 2015/10/09 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |