org.glassfish.grizzly.websockets
Class WebSocketConnectorHandler

java.lang.Object
  extended by org.glassfish.grizzly.websockets.WebSocketConnectorHandler

public class WebSocketConnectorHandler
extends Object

Client-side WebSocket connector handler, which is used to initiate client WebSocket connection.

Author:
Alexey Stashok

Constructor Summary
WebSocketConnectorHandler(TCPNIOTransport transport)
          Construct a WebSocketConnectorHandler basing on the specific TCP Transport object.
WebSocketConnectorHandler(TCPNIOTransport transport, Processor processor)
          Construct a WebSocketConnectorHandler basing on the specific TCP Transport object.
 
Method Summary
 Future<WebSocket> connect(ClientWebSocketMeta meta, WebSocketClientHandler handler)
          Creates, initializes and connects WebSocket to the specific application.
 Future<WebSocket> connect(URI uri, WebSocketClientHandler handler)
          Creates, initializes and connects WebSocket to the specific application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebSocketConnectorHandler

public WebSocketConnectorHandler(TCPNIOTransport transport)
Construct a WebSocketConnectorHandler basing on the specific TCP Transport object. The underlying Grizzly Connection will use a default websockets FilterChain.

Parameters:
transport - TCPNIOTransport

WebSocketConnectorHandler

public WebSocketConnectorHandler(TCPNIOTransport transport,
                                 Processor processor)
Construct a WebSocketConnectorHandler basing on the specific TCP Transport object. The underlying Grizzly Connection will use the provided Processor.

Parameters:
transport - TCPNIOTransport
processor - custom NIO events Processor
Method Detail

connect

public Future<WebSocket> connect(URI uri,
                                 WebSocketClientHandler handler)
                          throws IOException,
                                 HandshakeException
Creates, initializes and connects WebSocket to the specific application.

Parameters:
uri - WebSocket application URL.
handler - WebSocketClientHandler, which will handle WebSocket's events.
Returns:
Future of the connect operation, which could be used to get resulting WebSocket.
Throws:
IOException
HandshakeException

connect

public Future<WebSocket> connect(ClientWebSocketMeta meta,
                                 WebSocketClientHandler handler)
                          throws IOException,
                                 HandshakeException
Creates, initializes and connects WebSocket to the specific application.

Parameters:
meta - ClientWebSocketMeta.
handler - WebSocketClientHandler, which will handle WebSocket's events.
Returns:
Future of the connect operation, which could be used to get resulting WebSocket.
Throws:
IOException
HandshakeException


Copyright © 2010 Oracle Corpration. All Rights Reserved.