Examples of CoreException


Examples of com.adito.core.CoreException

    }

    void stopLocalTunnels(MultiplexedConnection agent, Collection<Tunnel> tunnels) throws CoreException {

        CoreException e = null;

        for (Tunnel tunnel : tunnels) {
            try {
                ByteArrayWriter msg = new ByteArrayWriter();
                msg.writeInt(tunnel.getResourceId());
View Full Code Here

Examples of com.adito.core.CoreException

        }
    }

    void stopRemoteTunnels(MultiplexedConnection agent, Collection<Tunnel> tunnels) throws CoreException {

        CoreException e = null;

        for (Tunnel tunnel : tunnels) {
            try {
                RemoteTunnel rt = RemoteTunnelManagerFactory.getInstance().getRemoteTunnel(tunnel.getResourceId());
                if (rt != null) {
View Full Code Here

Examples of com.adito.core.CoreException

        return (int) rdr.readInt();
        }
      }

    } catch (Exception e) {
      throw new CoreException(0, "", e);
    }
    return -1;
  }
View Full Code Here

Examples of com.adito.core.CoreException

     */
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
                    throws Exception {
        String referer = DAVUtilities.encodePath(CoreUtil.getRequestReferer(request), false);
        if(referer == null) {
            throw new CoreException(ErrorConstants.ERR_MISSING_REQUEST_PARAMETER, ErrorConstants.CATEGORY_NAME, "referer");
        }
        String localeCode = request.getParameter("locale");
        if(localeCode == null) {
            throw new CoreException(ErrorConstants.ERR_MISSING_REQUEST_PARAMETER, ErrorConstants.CATEGORY_NAME, "locale");
        }
       
        /* Tokenize the locale parameter so we only get the first line. This prevents
         * a header injection exploit as the (not validated) locale gets added as
         * a cookie.
View Full Code Here

Examples of com.dtolabs.rundeck.core.CoreException

                    propValue=lookup.getProperty(CENTRALDISPATCHER_CLS_PROP);
                }
                centralDispatcherMgr = CentralDispatcherMgrFactory.create(propValue, this).getCentralDispatcher();
            } catch (CentralDispatcherException e) {
                System.err.println("unable to load central dispatcher class: "+e.getMessage());
                throw new CoreException(e);
            }
        }

        //plugin manager service inited first.  any pluggable services will then be
        //able to try to load providers via the plugin manager
View Full Code Here

Examples of org.eclipse.core.runtime.CoreException

  }
 
  private void throwCoreException(String message, Exception e) throws CoreException {
    IStatus status =
      new Status(IStatus.ERROR, WGADesignerPlugin.PLUGIN_ID, IStatus.OK, message, e);
    throw new CoreException(status);   
  }
View Full Code Here

Examples of org.eclipse.core.runtime.CoreException

                                    DataSource content = new FileDataSource(((IFile) resource).getLocation().toFile());
                                    try {
                                        _remoteServer.getServices().updateFSDesignResource(_remoteServer.getSession(), remotePath, content, resource.getLocalTimeStamp());
                                    }
                                    catch (WGAServiceException e) {
                                        throw new CoreException(new Status(IStatus.ERROR, WGADesignerPlugin.PLUGIN_ID, "Creating design file failed.", e));
                                    }
                                }
                                else if (resource.getType() == IResource.FOLDER) {
                                    try {
                                        _remoteServer.getServices().mkFSDesignDir(_remoteServer.getSession(), remotePath);
                                    }
                                    catch (WGAServiceException e) {
                                        throw new CoreException(new Status(IStatus.ERROR, WGADesignerPlugin.PLUGIN_ID, "Creating design folder failed.", e));
                                    }
                                }
                                return true;
                            }
                        });
View Full Code Here

Examples of org.eclipse.core.runtime.CoreException

    try {
      writer = new XMLWriter(OutputFormat.createPrettyPrint());
      writer.setOutputStream(new FileOutputStream(new File(getWGABase().getLocation().toFile(), "auth.xml")));
      writer.write(auth);
    } catch (Exception e) {
      throw new CoreException(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to generate default auth configuration.", e));
    } finally {
      try {
        if (writer != null) {
          writer.close();
        }
      } catch (IOException e) {
      }
    }
    FileOutputStream configFileStream = null;
    try {
      _config = WGARuntimeConfiguration.createDefaultConfig();
      synchronized (_wgaConfigLock) {
        configFileStream = new FileOutputStream(getConfigFile().getLocation().toFile());
        WGARuntimeConfiguration.write(_config, configFileStream);
      }
    } catch (Exception e) {
      throw new CoreException(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to generate default runtime configuration.", e));
    } finally {
      if (configFileStream != null) {
        try {
          configFileStream.close();
        } catch (IOException e) {
        }
      }

    }

    // create wga.xml defaults
    try {
      retrieveWGAConfig(true);
    } catch (IncompatibleWGAConfigVersion e) {
      // should not happen bc. config file does not exist yet - but for
      // sure we generate a notice
      throw new CoreException(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to generate default wga configuration.", e));
    } catch (IOException e) {
      throw new CoreException(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to generate default wga configuration.", e));
    }

    _project.refreshLocal(IResource.DEPTH_INFINITE, null);
  }
View Full Code Here

Examples of org.eclipse.core.runtime.CoreException

      WGADesign wgaDesign = (WGADesign) design;
      // create new folder and dirlink in design-root
      try {
        registerExternalDesign(wgaDesign);
      } catch (IOException e) {
        throw new CoreException(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to register external design.", e));
      }
    }

    if (createdb) {
      IContainer container = null;
      if (design instanceof WGADesign) {
        container = ((WGADesign) design).getProject();
      } else {
        container = (IFolder) design;
      }
      WGAConfiguration wgaConfig = null;
      try {
        wgaConfig = retrieveWGAConfig(true);
      } catch (IncompatibleWGAConfigVersion e) {
        MessageDialog.openWarning(Display.getDefault().getActiveShell(), "Warning",
            "Unable to register design in runtime. WGA Version seams to be incompatible. Please ensure you are using the latest version of WGADevelopmentStudio.");
        WGADesignerPlugin.getDefault().logError(e.getMessage(), e);
      } catch (IOException e) {
        throw new CoreException(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to create default wga configuration.", e));
      }

      if (wgaConfig != null) {
        if (dbkey == null) {
          dbkey = container.getName();
        }
        dbkey = dbkey.toLowerCase();
        if (title == null) {
          title = container.getName();
        }
        if (domain == null) {
          domain = wgaConfig.getDefaultDomain();
        }
        // check if db already exists
        boolean csExists = wgaConfig.hasContentDatabase(dbkey);
        if (csExists) {
          throw new CoreException(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "A database with key '" + dbkey + "' already exists."));
        } else {
          int existingDbs = wgaConfig.getContentDatabases().size();
          ContentStore cs = wgaConfig.createContentStoreOnEmbeddedServer(dbkey, container.getName());
          cs.setDomain(domain.getUid());
          cs.setTitle(title);

          if (properties != null) {
            cs.setDefaultLanguage(properties.getProperty(DesignTemplate.PROP_DEFAULT_LANGUAGE, Locale.getDefault().getLanguage()));
          } else {
            cs.setDefaultLanguage(Locale.getDefault().getLanguage());
          }

          // if this is the first autocreated db - make it the default
          // db
          if (wgaConfig.getDefaultDatabase() == null && existingDbs == 0) {
            wgaConfig.setDefaultDatabase(cs.getKey());
          }
        }

        try {
          saveWGAConfig(wgaConfig);
        } catch (Exception e) {
          throw new CoreException(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to update wga configfile.", e));
        }
      }
    }
  }
View Full Code Here

Examples of org.eclipse.core.runtime.CoreException

      WGARuntimeConfiguration.write(_config, configFileStream);

      _project.refreshLocal(IResource.DEPTH_ONE, null);
    } catch (Exception e) {
      WGADesignerPlugin.getDefault().logError("Unable to save config of runtime '" + getName() + "'.", e);
      throw new CoreException(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to save config of runtime '" + getName() + "'.", e));
    } finally {
      try {
        if (configFileStream != null) {
          configFileStream.close();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.