Examples of ExtensionException


Examples of com.adito.extensions.ExtensionException

        if (element.getName().equals(TYPE)) {

            // Plugin name
            String name = element.getAttributeValue("name");
            if (name == null || name.equals("")) {
                throw new ExtensionException(ExtensionException.FAILED_TO_PROCESS_DESCRIPTOR,
                    "The name attribute must be supplied for <languagePack> elements.");
            }

            // Create the definition
            packDefinition = new LanguagePackDefinition(descriptor, name);
            LanguagePackManager.getInstance().addLanguagePackDefinition(packDefinition);

            for (Iterator i = element.getChildren().iterator(); i.hasNext();) {
                Element el = (Element) i.next();
                if (el.getName().equals("classpath")) {
                    String path =  Util.trimmedBothOrBlank(el.getText());
                    if (path != null && !path.equals("")) {
                        File f = new File(descriptor.getApplicationBundle().getBaseDir(), path);
                        if (f.exists()) {
                            try {
                                URL u = f.toURL();
                                if (log.isInfoEnabled())
                                    log.info("Adding " + u + " to classpath");
                                packDefinition.addClassPath(u);
                            } catch (MalformedURLException murle) {
                            }
                        } else {
                            if (!"true".equals(SystemProperties.get("adito.useDevConfig"))) {
                                log.warn("Plugin classpath element " + f.getAbsolutePath() + " does not exist.");
                            }
                        }
                    }
                } else if (el.getName().equals("date")) {
                    String date = Util.trimmedBothOrBlank(el.getText());
                    if (Util.isNullOrTrimmedBlank(date)) {
                        throw new ExtensionException(ExtensionException.FAILED_TO_PROCESS_DESCRIPTOR,
                            "The content of the <date> must contain the creation date of the language in the pack.");
                    }
                    packDefinition.setDate(date);
                } else if (el.getName().equals("language")) {
                    String code = el.getAttributeValue("code");
                    if (code == null || code.equals("")) {
                        throw new ExtensionException(ExtensionException.FAILED_TO_PROCESS_DESCRIPTOR,
                            "The code attribute must be supplied for <language> elements.");
                    }
                    String description = Util.trimmedBothOrBlank(el.getText());
                    if (Util.isNullOrTrimmedBlank(description)) {
                        throw new ExtensionException(ExtensionException.FAILED_TO_PROCESS_DESCRIPTOR,
                            "The content of the <language> must contain the description of the language in the pack.");
                    }
                    packDefinition.addLanguage(new Language(packDefinition, code, description));
                } else {
                    throw new ExtensionException(ExtensionException.FAILED_TO_PROCESS_DESCRIPTOR,
                        "The <language> element only supports the nested <classpath> elements");
                }
            }
           
            // Now add the classpath. We will only do this once until the dynamic classloader is written
View Full Code Here

Examples of com.adito.extensions.ExtensionException

    public void startPlugin(PluginDefinition definition, ExtensionDescriptor descriptor, Element element) throws ExtensionException {
        super.startPlugin(definition, descriptor, element);
        try {
            initExtensionTypes();
        } catch (Exception e) {
            throw new ExtensionException(ExtensionException.INTERNAL_ERROR, e);
        }
    }
View Full Code Here

Examples of com.adito.extensions.ExtensionException

      initPageTasks();
            CoreUtil.updateEventsTable(ApplicationsPlugin.MESSAGE_RESOURCES_KEY, ApplicationShortcutEventConstants.class);
      CoreServlet.getServlet().addCoreListener(this);
    } catch (Exception e) {
            e.printStackTrace();
      throw new ExtensionException(ExtensionException.INTERNAL_ERROR, e);
    }
  }
View Full Code Here

Examples of com.adito.extensions.ExtensionException

            removeTableItemActions();
            removeMainMenu();
            removePageTasks();
            CoreServlet.getServlet().removeCoreListener(this);
        } catch (Exception e) {
            throw new ExtensionException(ExtensionException.INTERNAL_ERROR, e, "Failed to start.");
        }
    }
View Full Code Here

Examples of com.adito.extensions.ExtensionException

            initMainMenu();
            initPageTasks();
            initService();
            CoreUtil.updateEventsTable(TunnelPlugin.MESSAGE_RESOURCES_KEY, TunnelsEventConstants.class);
        } catch (Exception e) {
            throw new ExtensionException(ExtensionException.INTERNAL_ERROR, e, e.getLocalizedMessage());
        }
    }
View Full Code Here

Examples of com.adito.extensions.ExtensionException

            removeTableItemActions();
            removeMainMenu();
            removePageTasks();
            stopService();
        } catch (Exception e) {
            throw new ExtensionException(ExtensionException.INTERNAL_ERROR, e);
        }
    }
View Full Code Here

Examples of org.apache.airavata.core.gfac.exception.ExtensionException

                }
            } else {
                log.debug("Output Context is null");
            }
        } catch (UnknownHostException e) {
            throw new ExtensionException("Cannot find IP Address for current host", e);
        } catch (URISyntaxException e) {
            throw new ExtensionException("URI is in the wrong format:" + e.getMessage(), e);
        } catch (ToolsException e) {
            throw new ExtensionException(e.getMessage(), e);
        } catch (SecurityException e) {
            throw new ExtensionException(e.getMessage(), e);
        }
        return false;
    }
View Full Code Here

Examples of org.apache.airavata.core.gfac.exception.ExtensionException

                }
            } else {
                log.debug("Input Context is null");
            }
        } catch (SecurityException e) {
            throw new ExtensionException(e.getMessage(), e);
        } catch (ToolsException e) {
            throw new ExtensionException(e.getMessage(), e);
        } catch (URISyntaxException e) {
            throw new ExtensionException("URI is in the wrong format:" + e.getMessage(), e);
        } catch (IOException e) {
            throw new ExtensionException("Cannot load from HTTP", e);
        }
        return false;
    }
View Full Code Here

Examples of org.apache.airavata.core.gfac.exception.ExtensionException

            } else {
                log.debug("Input Context is null");
            }

        } catch (UnknownHostException e) {
            throw new ExtensionException("Cannot find IP Address for current host", e);
        } catch (URISyntaxException e) {
            throw new ExtensionException("URI is in the wrong format:" + e.getMessage(), e);
        } catch (ToolsException e) {
            throw new ExtensionException(e.getMessage(), e);
        } catch (SecurityException e) {
            throw new ExtensionException(e.getMessage(), e);
        }
        return false;
    }
View Full Code Here

Examples of org.apache.airavata.core.gfac.exception.ExtensionException

                appDesc.setStandardError(appDesc.getStaticWorkingDirectory() + File.separator
                        + appDesc.getApplicationName().getStringValue() + ".stderr");
            }

        } else {
            throw new ExtensionException("Service Map for " + context.getServiceName()
                    + " does not found on resource Catalog " + context.getExecutionContext().getRegistryService());
        }

        return false;
    }
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.