Package org.nasutekds.quicksetup.util

Examples of org.nasutekds.quicksetup.util.ServerController


   * @throws ApplicationException if the server could not be started.
   */
  protected void startServerWithoutConnectionHandlers()
  throws ApplicationException {
    try {
      ServerController control = new ServerController(getInstallation());
      if (getInstallation().getStatus().isServerRunning()) {
        control.stopServer(true);
      }
      InProcessServerController ipsc =
              new InProcessServerController(getInstallation());
      InProcessServerController.disableConnectionHandlers(true);
      ipsc.startServer();
View Full Code Here


      // Leave the server in the state requested by the user via the
      // checkbox on the review panel.  The upgrade has already been
      // verified at this point to in the unlikely event of an error,
      // we call this a warning instead of an error.
      try {
        ServerController control = new ServerController(getInstallation());
        boolean serverRunning = getInstallation().getStatus().isServerRunning();
        boolean userRequestsStart = getUserData().getStartServer();
        if (userRequestsStart && !serverRunning) {
          try {
            LOG.log(Level.INFO, "starting server");
            setCurrentProgressStep(UpgradeProgressStep.STARTING_SERVER);
            if (isVerbose())
            {
              notifyListeners(getTaskSeparator());
            }
            else
            {
              notifyListeners(getFormattedWithPoints(
                  INFO_PROGRESS_STARTING_NON_VERBOSE.get()));
            }
            int port = getInstallation().getCurrentConfiguration().getPort();
            if (port != -1 && !Utils.canUseAsPort(port)) {
              throw new ApplicationException(
                  ReturnCode.APPLICATION_ERROR,
                      INFO_ERROR_PORT_IN_USE.get(Integer.toString(port)),
                      null);
            }
            control.startServer(!isVerbose());
            if (!isVerbose())
            {
              notifyListeners(getFormattedDoneWithLineBreak());
            }
            else
            {
              notifyListeners(getLineBreak());
            }
          } catch (ApplicationException e) {
            if (isVerbose())
            {
              notifyListeners(getLineBreak());
            }
            notifyListeners(getFormattedErrorWithLineBreak());
            LOG.log(Level.INFO, "error starting server");
            this.runWarning = e;
          }
        } else if (!userRequestsStart && serverRunning) {
          try {
            LOG.log(Level.INFO, "stopping server");
            if (isVerbose())
            {
              notifyListeners(getTaskSeparator());
            }
            else
            {
              notifyListeners(getFormattedWithPoints(
                  INFO_PROGRESS_STOPPING_NON_VERBOSE.get()));
            }
            setCurrentProgressStep(UpgradeProgressStep.STOPPING_SERVER);
            control.stopServer(!isVerbose());
            if (!isVerbose())
            {
              notifyListeners(getFormattedDoneWithLineBreak());
            }
            else
View Full Code Here

          }
        }

        // Restart the server after putting the files
        // back like we found them.
        ServerController sc = new ServerController(getInstallation());
        sc.stopServer(true);
        sc.startServer(true);

      } catch (IOException e) {
        LOG.log(Level.INFO, "Error getting backup directory", e);
      }
    }
View Full Code Here

                  INFO_UPGRADE_ORACLE_SAME_VERSION.get(
                  toVersion.toString()), null);
        }
      }
      if (getInstallation().getStatus().isServerRunning()) {
        new ServerController(getInstallation()).stopServer(true);
      }

      this.historicalOperationId =
              writeInitialHistoricalRecord(fromVersion, toVersion);
View Full Code Here

      // Stop the server if necessary.  Task note as to whether the server
      // is running since we will leave it in that state when we are done.
      Installation installation = getInstallation();
      Status status = installation.getStatus();
      ServerController sc = new ServerController(installation);
      if (status.isServerRunning()) {
        restartServer = true;
        sc = new ServerController(installation);
        try {
          setCurrentProgressStep(ReversionProgressStep.STOPPING_SERVER);
          LOG.log(Level.INFO, "Stopping server");

          if (isVerbose())
          {
            notifyListeners(getTaskSeparator());
          }
          else
          {
            notifyListeners(getFormattedWithPoints(
                INFO_PROGRESS_STOPPING_NON_VERBOSE.get()));
          }

          sc.stopServer(!isVerbose());

          if (!isVerbose())
          {
            notifyListeners(getFormattedDoneWithLineBreak());
          }
          else
          {
            notifyListeners(getLineBreak());
          }
        } catch (ApplicationException ae) {
          runError = ae;
          notifyListeners(getFormattedErrorWithLineBreak());
        }
      }

      try {
        setCurrentProgressStep(ReversionProgressStep.INITIALIZING);
        initialize();
        notifyListeners(getFormattedDoneWithLineBreak());
      } catch (ApplicationException ae) {
        LOG.log(Level.INFO, "Error initializing reversion", ae);
        notifyListeners(getFormattedErrorWithLineBreak());
        throw ae;
      }

      try {
        LOG.log(Level.INFO, "Reverting components");
        setCurrentProgressStep(ReversionProgressStep.REVERTING_FILESYSTEM);
        revertComponents();
        LOG.log(Level.INFO, "Finished reverting components");
        notifyListeners(getFormattedDoneWithLineBreak());
      } catch (ApplicationException ae) {
        LOG.log(Level.INFO, "Error reverting components", ae);
        notifyListeners(getFormattedErrorWithLineBreak());
        throw ae;
      }

      if (restartServer) {
        try {
          LOG.log(Level.INFO, "Restarting server");
          setCurrentProgressStep(ReversionProgressStep.STARTING_SERVER);
          if (isVerbose())
          {
            notifyListeners(getTaskSeparator());
          }
          else
          {
            notifyListeners(getFormattedWithPoints(
                INFO_PROGRESS_STARTING_NON_VERBOSE.get()));
          }
          sc.startServer(!isVerbose());
          if (!isVerbose())
          {
            notifyListeners(getFormattedDoneWithLineBreak());
          }
          else
View Full Code Here

   * Gets a server controller for use by this application.
   * @return ServerController that can be used to start and stop the server.
   */
  public ServerController getServerController() {
    if (serverController == null) {
      serverController = new ServerController(this);
    }
    return serverController;
  }
View Full Code Here

          "stderr contents: " + stdErr.toString());
    }
  }

  static public void stopServer() throws ApplicationException {
    ServerController controller = new ServerController(getInstallation());
    controller.stopServer();
  }
View Full Code Here

              System.out.print(ev.getNewLogs().toString());
              System.out.flush();
            }
          });
    }
    ServerController controller = new ServerController(application,
        Installation.getLocal());
    try
    {
      if (!supressOutput)
      {
        printlnProgress();
      }
      controller.startServer(supressOutput);
      if (!supressOutput)
      {
        printlnProgress();
      }
      serverStarted = Installation.getLocal().getStatus().isServerRunning();
View Full Code Here

        // In order to bypass the tools.properties mechanism, if any,
        // we systematically add the --noPropertiesFile flag
        // when we run the stop-ds command. This is done
        // by setting the parameter "noPropertiesFile" to 'true'
        // in the following call.
        new ServerController(this).stopServer(!isVerbose(),true);
        if (!isVerbose())
        {
          notifyListeners(getFormattedDoneWithLineBreak());
        }
        displaySeparator = true;
View Full Code Here

    {
      public void run()
      {
        try
        {
          new ServerController(Uninstaller.this).startServer();
          final boolean isServerRunning =
            Installation.getLocal().getStatus().isServerRunning();
          returnValue[0] = isServerRunning;
          SwingUtilities.invokeLater(new Runnable()
          {
View Full Code Here

TOP

Related Classes of org.nasutekds.quicksetup.util.ServerController

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.