@Override public synchronized void processConnect(WebSocketChannel channel,WSURI uri,String[] protocols){
  LOG.entering(CLASS_NAME,"processConnect",new Object[]{uri,protocols});
  try {
    WebSocketNativeChannel nativeChannel=(WebSocketNativeChannel)channel;
    if (nativeChannel.getProxy() != null) {
      throw new IllegalStateException("Bridge proxy previously set");
    }
    Proxy proxy=BridgeUtil.createProxy(uri.getURI(),this);
    proxy.setPeer(channel);
    nativeChannel.setProxy(proxy);
    String[] params;
    if (protocols != null) {
      String s="";
      for (int i=0; i < protocols.length; i++) {
        if (i > 0) {
          s+=",";
        }
        s+=protocols[i];
      }
      params=new String[]{"WEBSOCKET",uri.toString(),s,""};
    }
 else {
      params=new String[]{"WEBSOCKET",uri.toString()};
    }
    proxy.processEvent(XoaEventKind.CREATE,params);
  }
 catch (  Exception e) {
    LOG.log(Level.FINE,"While initializing WebSocket proxy: " + e.getMessage(),e);
    listener.connectionFailed(channel,e);
  }
}

@ Override public synchronized void processConnect ( WebSocketChannel channel , WSURI uri , String [ ] protocols ) { LOG . entering ( CLASS_NAME , "processConnect" , new Object [ ] { uri , protocols } ) ; try { WebSocketNativeChannel nativeChannel = ( WebSocketNativeChannel ) channel ; if ( nativeChannel . getProxy ( ) != null ) { throw new IllegalStateException ( "Bridge proxy previously set" ) ; } Proxy proxy = BridgeUtil . createProxy ( uri . getURI ( ) , this ) ; proxy . setPeer ( channel ) ; nativeChannel . setProxy ( proxy ) ; String [ ] params ; if ( protocols != null ) { String s = "" ; for ( int i = 0 ; i < protocols . length ; i ++ ) { if ( i > 0 ) { s += "," ; } s += protocols [ i ] ; } params = new String [ ] { "WEBSOCKET" , uri . toString ( ) , s , "" } ; } else { params = new String [ ] { "WEBSOCKET" , uri . toString ( ) } ; } proxy . processEvent ( XoaEventKind . CREATE , params ) ; } catch ( Exception e ) { LOG . log ( Level . FINE , "While initializing WebSocket proxy: " + e . getMessage ( ) , e ) ; listener . connectionFailed ( channel , e ) ; } }
establishes the websocket connection
