org.glassfish.grizzly.websockets
Interface WebSocket

All Known Implementing Classes:
WebSocketBase

public interface WebSocket

General WebSocket unit interface.

Author:
Alexey Stashok
See Also:
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.
 

Method Detail

send

GrizzlyFuture<Frame> send(Frame frame)
                          throws IOException
Send a message, represented as WebSocket Frame.

Parameters:
frame - Frame.
Returns:
GrizzlyFuture, which could be used to control the sending completion state.
Throws:
IOException

send

GrizzlyFuture<Frame> send(Frame frame,
                          CompletionHandler<Frame> completionHandler)
                          throws IOException
Send a message, represented as WebSocket Frame.

Parameters:
frame - Frame.
completionHandler - CompletionHandler, which could be used to control the message sending state.
Returns:
GrizzlyFuture, which could be used to control the sending completion state.
Throws:
IOException

close

void close()
           throws IOException
Close the WebSocket. The close operation will do the following steps: 1) try to send a close frame 2) call WebSocketHandler.onClose(org.glassfish.grizzly.websockets.WebSocket) method 3) close the underlying Connection

Throws:
IOException

isConnected

boolean isConnected()
Returns true if the WebSocket is connected and ready to operate, or false otherwise.

Returns:
true if the WebSocket is connected and ready to operate, or false otherwise.

getURI

URI getURI()
Gets the WebSocket URI.

Returns:
the WebSocket URI.

getConnection

Connection getConnection()
Gets the WebSocket's underlying Connection.

Returns:
the WebSocket's underlying Connection.

getMeta

WebSocketMeta getMeta()
Returns the WebSocket's meta data.

Returns:
WebSocketMeta.

getHandler

WebSocketHandler getHandler()
Returns the WebSocket's events handler.

Returns:
WebSocketHandler.


Copyright © 2010 Oracle Corpration. All Rights Reserved.