Ejemplo n.º 1
0
  @Override
  public Object execute(ExecutionEvent event) throws ExecutionException {
    try {
      Liferay7UpgradeAssistantSettings settings =
          UpgradeAssistantSettingsUtil.getObjectFromStore(Liferay7UpgradeAssistantSettings.class);

      final String portalName = settings.getPortalSettings().getNewName();

      IServer server = ServerCore.findServer(portalName);

      server.start("run", new NullProgressMonitor());
    } catch (IOException | CoreException e) {
      e.printStackTrace();
    }

    return null;
  }
 public boolean startServer(String serverId, Object shell) {
   IServer server = getServer(serverId);
   if (server == null) return false;
   else {
     try {
       if (server.getServerState() != IServer.STATE_STARTING) {
         server.start("run", (IProgressMonitor) null);
       }
       if (shell == null) return true;
       else {
         if (shell instanceof Shell) return waitUntilTheServerStarts(server, (Shell) shell);
         else return true;
       }
     } catch (CoreException e) {
       return false;
     }
   }
 }