org.glassfish.grizzly.websockets
Class DefaultWebSocket
java.lang.Object
org.glassfish.grizzly.websockets.DefaultWebSocket
- All Implemented Interfaces:
- WebSocket
- Direct Known Subclasses:
- WebSocketClient
public class DefaultWebSocket
- extends java.lang.Object
- implements WebSocket
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
protocolHandler
protected final ProtocolHandler protocolHandler
DefaultWebSocket
public DefaultWebSocket(ProtocolHandler protocolHandler,
WebSocketListener... listeners)
getListeners
public java.util.Collection<WebSocketListener> getListeners()
add
public final boolean add(WebSocketListener listener)
- Specified by:
add in interface WebSocket
remove
public final boolean remove(WebSocketListener listener)
- Specified by:
remove in interface WebSocket
isConnected
public boolean isConnected()
- Specified by:
isConnected in interface WebSocket
setClosed
public void setClosed()
onClose
public void onClose(DataFrame frame)
- Specified by:
onClose in interface WebSocket
onConnect
public void onConnect()
- Specified by:
onConnect in interface WebSocket
onFragment
public void onFragment(boolean last,
byte[] fragment)
- Specified by:
onFragment in interface WebSocket
onFragment
public void onFragment(boolean last,
java.lang.String fragment)
- Specified by:
onFragment in interface WebSocket
onMessage
public void onMessage(byte[] data)
- Specified by:
onMessage in interface WebSocket
onMessage
public void onMessage(java.lang.String text)
- Specified by:
onMessage in interface WebSocket
onPing
public void onPing(DataFrame frame)
- Specified by:
onPing in interface WebSocket
onPong
public void onPong(DataFrame frame)
- Specified by:
onPong in interface WebSocket
close
public void close()
- Specified by:
close in interface WebSocket
close
public void close(int code)
- Specified by:
close in interface WebSocket
close
public void close(int code,
java.lang.String reason)
- Specified by:
close in interface WebSocket
send
public GrizzlyFuture<DataFrame> send(byte[] data)
- Description copied from interface:
WebSocket
- Send a text frame
- Specified by:
send in interface WebSocket
- Returns:
GrizzlyFuture, which could be used to control the sending completion state.
send
public GrizzlyFuture<DataFrame> send(java.lang.String data)
- Description copied from interface:
WebSocket
- Send a text frame
- Specified by:
send in interface WebSocket
- Returns:
GrizzlyFuture, which could be used to control the sending completion state.
stream
public GrizzlyFuture<DataFrame> stream(boolean last,
java.lang.String fragment)
- Specified by:
stream in interface WebSocket
stream
public GrizzlyFuture<DataFrame> stream(boolean last,
byte[] bytes,
int off,
int len)
- Specified by:
stream in interface WebSocket
Copyright © 2011 Oracle Corpration. All Rights Reserved.