code: public static void updateConfigDynamically(LibertyServer server, ServerConfiguration config, boolean waitForAppToStart) throws Exception {
          resetMarksInLogs(server);
          server.updateServerConfiguration(config);
          server.waitForStringInLogUsingMark("CWWKG001[7-8]I");
          if (waitForAppToStart) {
              server.waitForStringInLogUsingMark("CWWKZ0003I"); //CWWKZ0003I: The application **** updated in 0.020 seconds.
          }
      }
docs: This method will the reset the log and trace marks for log and trace searches, update the
  configuration and then wait for the server to re-initialize. Optionally it will then wait for the application to start.
  
  @param server The server to update.
  @param config The configuration to use.
  @param waitForAppToStart Wait for the application to start.
  @throws Exception If there was an issue updating the server configuration.