com.sun.grizzly.websockets
Class WebSocketApplication

java.lang.Object
  extended by com.sun.grizzly.websockets.WebSocketAdapter
      extended by com.sun.grizzly.websockets.WebSocketApplication
All Implemented Interfaces:
WebSocketListener
Direct Known Subclasses:
ChatApplication, StickiesApplication

public abstract class WebSocketApplication
extends WebSocketAdapter


Constructor Summary
WebSocketApplication()
           
 
Method Summary
protected  boolean add(WebSocket socket)
           
 WebSocket createWebSocket(ProtocolHandler protocolHandler, WebSocketListener... listeners)
           
 List<String> getSupportedExtensions()
           
 List<String> getSupportedProtocols(List<String> subProtocol)
           
protected  Set<WebSocket> getWebSockets()
          Returns a set of WebSockets, registered with the application.
abstract  boolean isApplicationRequest(Request 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)
           
 
Methods inherited from class com.sun.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

WebSocketApplication

public WebSocketApplication()
Method Detail

createWebSocket

public WebSocket createWebSocket(ProtocolHandler protocolHandler,
                                 WebSocketListener... listeners)

getWebSockets

protected Set<WebSocket> getWebSockets()
Returns a set of WebSockets, registered with the application. The returned set is unmodifiable, the possible modifications may cause exceptions.

Returns:
a set of WebSockets, registered with the application.

add

protected boolean add(WebSocket socket)

remove

public boolean remove(WebSocket socket)

onClose

public void onClose(WebSocket socket,
                    DataFrame frame)
Specified by:
onClose in interface WebSocketListener
Overrides:
onClose in class WebSocketAdapter

onConnect

public void onConnect(WebSocket socket)
Specified by:
onConnect in interface WebSocketListener
Overrides:
onConnect in class WebSocketAdapter

isApplicationRequest

public abstract boolean isApplicationRequest(Request request)
Checks application specific criteria to determine if this application can process the Request as a WebSocket connection.

Parameters:
request -
Returns:
true if this application can service this Request

getSupportedExtensions

public List<String> getSupportedExtensions()

getSupportedProtocols

public List<String> getSupportedProtocols(List<String> subProtocol)


Copyright © 2012 Oracle Corporation. All Rights Reserved.