コード例 #1
0
  @Override
  public void startup() {
    int port =
        spaceEnvironment
            .getSystemConfiguration()
            .getPropertyInteger(
                MasterWebsocketManager.CONFIGURATION_MASTER_WEBSOCKET_PORT,
                MasterWebsocketManager.CONFIGURATION_MASTER_WEBSOCKET_PORT_DEFAULT);

    webServer =
        new NettyWebServer(
            "master", port, spaceEnvironment.getExecutorService(), spaceEnvironment.getLog());

    webSocketFactory =
        new BasicMultipleConnectionWebServerWebSocketHandlerFactory(
            this, spaceEnvironment.getLog());

    webServer.setWebSocketHandlerFactory("", webSocketFactory);

    webServer.startup();

    remoteSpaceControllerClient.addRemoteSpaceControllerClientListener(this);
  }
 /** Set the web server web socket handler with the proper wrapped factory. */
 private void setWebServerWebSocketHandlerFactory() {
   webServer.setWebSocketHandlerFactory(
       webSocketUriPrefix, new MyWebServerWebSocketHandlerFactory(webSocketHandlerFactory, this));
 }