|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.grizzly.websockets.WebSocketAdapter
org.glassfish.grizzly.websockets.WebSocketApplication
public abstract class WebSocketApplication
Abstract server-side WebSocket application, which will handle
application WebSockets events.
| Constructor Summary | |
|---|---|
WebSocketApplication()
|
|
| Method Summary | |
|---|---|
protected boolean |
add(WebSocket socket)
|
WebSocket |
createSocket(ProtocolHandler handler,
WebSocketListener... listeners)
|
java.util.List<java.lang.String> |
getSupportedExtensions()
|
java.util.List<java.lang.String> |
getSupportedProtocols(java.util.List<java.lang.String> subProtocol)
|
protected java.util.Set<WebSocket> |
getWebSockets()
Returns a set of WebSockets, registered with the application. |
protected void |
handshake(HandShake handshake)
Method is called, when initial WebSocket handshake process was completed,
but WebSocketApplication may perform additional validation such as subprotocol or extension negotiation. |
abstract boolean |
isApplicationRequest(HttpRequestPacket request)
Checks application specific criteria to determine if this application can process the Request as a WebSocket connection. |
void |
onClose(WebSocket socket,
DataFrame frame)
|
void |
onConnect(WebSocket socket)
|
boolean |
remove(WebSocket socket)
|
boolean |
upgrade(HttpRequestPacket request)
Checks protocol specific information and queries #isApplicationRequest(Request) to see if the Request should be upgraded. |
| Methods inherited from class org.glassfish.grizzly.websockets.WebSocketAdapter |
|---|
onFragment, onFragment, onMessage, onMessage, onPing, onPong |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WebSocketApplication()
| Method Detail |
|---|
protected java.util.Set<WebSocket> getWebSockets()
WebSockets, registered with the application.
The returned set is unmodifiable, the possible modifications may cause exceptions.
WebSockets, registered with the application.protected boolean add(WebSocket socket)
public boolean remove(WebSocket socket)
public WebSocket createSocket(ProtocolHandler handler,
WebSocketListener... listeners)
protected void handshake(HandShake handshake)
throws HandshakeException
WebSocket handshake process was completed,
but WebSocketApplication may perform additional validation such as subprotocol or extension negotiation.
HandshakeException - error occurred during the handshake.
public void onClose(WebSocket socket,
DataFrame frame)
onClose in interface WebSocketListeneronClose in class WebSocketAdapterpublic void onConnect(WebSocket socket)
onConnect in interface WebSocketListeneronConnect in class WebSocketAdapterpublic final boolean upgrade(HttpRequestPacket request)
public abstract boolean isApplicationRequest(HttpRequestPacket request)
request -
public java.util.List<java.lang.String> getSupportedExtensions()
public java.util.List<java.lang.String> getSupportedProtocols(java.util.List<java.lang.String> subProtocol)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||