|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.grizzly.websockets.WebSocketBase
public class WebSocketBase
The WebSocket base implementation.
WebSocket| Field Summary | |
|---|---|
protected Connection |
connection
|
protected WebSocketHandler |
handler
|
protected WebSocketMeta |
meta
|
| Constructor Summary | |
|---|---|
WebSocketBase(Connection connection,
WebSocketMeta meta,
WebSocketHandler handler)
Construct a WebSocketBase. |
|
| Method Summary | |
|---|---|
void |
close()
Close the WebSocket. |
Connection |
getConnection()
Gets the WebSocket's underlying Connection. |
WebSocketHandler |
getHandler()
Returns the WebSocket's events handler. |
WebSocketMeta |
getMeta()
Returns the WebSocket's meta data. |
URI |
getURI()
Gets the WebSocket URI. |
boolean |
isConnected()
Returns true if the WebSocket is connected and ready to operate, or false otherwise. |
GrizzlyFuture<Frame> |
send(Frame frame)
Send a message, represented as WebSocket Frame. |
GrizzlyFuture<Frame> |
send(Frame frame,
CompletionHandler<Frame> completionHandler)
Send a message, represented as WebSocket Frame. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final WebSocketMeta meta
protected final Connection connection
protected final WebSocketHandler handler
| Constructor Detail |
|---|
public WebSocketBase(Connection connection,
WebSocketMeta meta,
WebSocketHandler handler)
connection - underlying Grizzly Connection.meta - WebSocketMeta info| Method Detail |
|---|
public URI getURI()
getURI in interface WebSocketpublic WebSocketMeta getMeta()
getMeta in interface WebSocketWebSocketMeta.public WebSocketHandler getHandler()
getHandler in interface WebSocketWebSocketHandler.public Connection getConnection()
Connection.
getConnection in interface WebSocketConnection.
public final GrizzlyFuture<Frame> send(Frame frame)
throws IOException
Frame.
send in interface WebSocketframe - Frame.
GrizzlyFuture, which could be used to control the sending completion state.
IOException
public GrizzlyFuture<Frame> send(Frame frame,
CompletionHandler<Frame> completionHandler)
throws IOException
Frame.
send in interface WebSocketframe - Frame.completionHandler - CompletionHandler, which could be used
to control the message sending state.
GrizzlyFuture, which could be used to control the sending
completion state.
IOException
public void close()
throws IOException
WebSocketHandler.onClose(org.glassfish.grizzly.websockets.WebSocket) method
3) close the underlying Connection
close in interface WebSocketIOExceptionpublic boolean isConnected()
isConnected in interface WebSocket
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||