Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.CoreException


      IStatus status = validationHandler.getNextNonOKEvent();
      if (status == null) {
        status = CloudFoundryPlugin.getErrorStatus(Messages.ERROR_UNKNOWN_SERVER_CREATION_ERROR);
      }
      throw new CoreException(status);
    }

    ServerLifecycleAdapter listener = new ServerLifecycleAdapter() {
      @Override
      public void serverAdded(IServer server) {
View Full Code Here


  @Override
  public IModule[] getRootModules(IModule module) throws CoreException {
    if (ApplicationRegistry.isSupportedModule(module)) {
      IStatus status = canModifyModules(new IModule[] { module }, null);
      if (status == null || !status.isOK()) {
        throw new CoreException(status);
      }
      return new IModule[] { module };
    }

    return J2EEUtil.getWebModules(module, null);
View Full Code Here

            wc.modifyModules(add, null, monitor);
            wc.save(true, null);
            republished = true;
          }
          else {
            throw new CoreException(status);
          }
        }
      }

    }

    if (!republished) {
      throw new CoreException(CloudFoundryPlugin.getErrorStatus(NLS.bind(Messages.RepublishApplicationHandler_ERROR_REPUBLISH_FAIL,
          appModule.getDeployedApplicationName())));
    }

  }
View Full Code Here

    try {

      List<String> processArguments = getProcessArguments();

      if (processArguments == null || processArguments.isEmpty()) {
        throw new CoreException(getErrorStatus("No process arguments were found")); //$NON-NLS-1$
      }
      else {

        ProcessBuilder processBuilder = new ProcessBuilder(processArguments);

        // Set any environment variables
        Map<String, String> envVars = getEnvironmentVariables();
        if (envVars != null) {
          Map<String, String> actualVars = processBuilder.environment();
          if (actualVars != null) {
            for (Entry<String, String> entry : envVars.entrySet()) {
              actualVars.put(entry.getKey(), entry.getValue());
            }
          }
        }

        p = processBuilder.start();

        if (p == null) {
          throw new CoreException(getErrorStatus("No process was created.")); //$NON-NLS-1$
        }
        else {

          StringBuffer errorBuffer = new StringBuffer();
          // Clear the input and error streams to prevent the
          // process
          // from blocking
          handleProcessIOAsynch(p, null, errorBuffer);

          p.waitFor();

          if (errorBuffer.length() > 0) {
            throw new CoreException(getErrorStatus(errorBuffer.toString()));
          }
          else if (p.exitValue() != 0) {
            throw new CoreException(getErrorStatus("process exit value: " + p.exitValue())); //$NON-NLS-1$
          }
        }
      }
    }
    catch (InterruptedException ex) {
View Full Code Here

      descriptor = internalUpdateDescriptor(urlText, userName, password, selfSigned, context);
    }

    IStatus status = validateCurrent(getCurrentCloudSpace());
    if (status != null && !status.isOK()) {
      throw new CoreException(status);
    }
    return descriptor;
  }
View Full Code Here

        break;
      }
    }

    if (!isValid) {
      throw new CoreException(
          CloudFoundryPlugin.getErrorStatus(NLS
              .bind(Messages.CloudSpacesDelegate_ERROR_FAIL_LOADING_CLOUDSPACES,
                  new String[] { actualURL, userName })));
    }
  }
View Full Code Here

      else {
        if (status[0].isOK()) {
          status[0] = appModule.validateDeploymentInfo();
        }
        if (!status[0].isOK()) {
          throw new CoreException(status[0]);
        }
        else if (writeToManifest[0]) {

          IProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1);
          try {
View Full Code Here

      }

      return supportsSpaces[0];
    }
    catch (OperationCanceledException e) {
      throw new CoreException(CloudFoundryPlugin.getErrorStatus(e));
    }

  }
View Full Code Here

        tailingOffset += content.length();
      }
      return content;
    }
    catch (CloudFoundryException cfex) {
      throw new CoreException(CloudFoundryPlugin.getErrorStatus(cfex));
    }
  }
View Full Code Here

    // stream
    String message = null;
    if (adjustErrorCount()) {
      message = reachedMaximumErrors(ce);
      if (message != null) {
        throw new CoreException(CloudFoundryPlugin.getErrorStatus(message, ce));
      }
    }

    // Otherwise see if there is a message on retry that should be sent to
    // the console
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.CoreException

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.