code: @SuppressWarnings("unchecked")
      public void onOpen(Session session, EndpointConfig configuration) {
          for (MessageHandlerFactory f : messageHandlerFactories) {
              MessageHandler handler = f.create(session);
              final Class<?> handlerClass = getHandlerType(handler);
  
              if (handler instanceof MessageHandler.Whole) { //WHOLE MESSAGE HANDLER
                  session.addMessageHandler(handlerClass, (MessageHandler.Whole) handler);
              } else if (handler instanceof MessageHandler.Partial) { // PARTIAL MESSAGE HANDLER
                  session.addMessageHandler(handlerClass, (MessageHandler.Partial) handler);
              }
          }
  
          if (getOnOpenHandle() != null) {
              callMethod(getOnOpenHandle(), getOnOpenParameters(), session, true);
          }
      }
docs: <p>onOpen.</p>
  
  @param session a {@link javax.websocket.Session} object.
  @param configuration a {@link javax.websocket.EndpointConfig} object.