Examples of PluginException


Examples of com.abiquo.ssm.exception.PluginException

    @Override
    public StoragePluginMetadata getPluginMetadata() throws PluginException
    {
        if (!this.getClass().isAnnotationPresent(Plugin.class))
        {
            throw new PluginException("Missing @Plugin annotation in " + this.getClass().getName());
        }

        Plugin pluginInfo = this.getClass().getAnnotation(Plugin.class);

        if (pluginInfo.type() == null)
        {
            throw new PluginException("Plugin type can not be null in " + this.getClass().getName());
        }

        StoragePluginMetadata metadata = new StoragePluginMetadata();
        metadata.setDefaultIscsiPort(pluginInfo.defaultIscsiPort());
        metadata.setDefaultManagementPort(pluginInfo.defaultManagementPort());
        metadata.setRequiresAuthentication(pluginInfo.requiresAuthentication());
        metadata.setType(pluginInfo.type());

        try
        {
            Method[] methods = StoragePlugin.class.getMethods();
            for (Method methodDefinition : methods)
            {
                if (methodDefinition.isAnnotationPresent(Provides.class))
                {
                    Method implMethod =
                        this.getClass().getMethod(methodDefinition.getName(),
                            methodDefinition.getParameterTypes());

                    if (!implMethod.isAnnotationPresent(UnsupportedOp.class))
                    {
                        Provides provides = methodDefinition.getAnnotation(Provides.class);
                        metadata.getSupportedOperations().add(provides.value());
                    }
                }
            }
        }
        catch (Exception ex)
        {
            throw new PluginException("Could not get the list of supported operations for plugin: "
                + this.getClass().getName());
        }

        return metadata;
    }
View Full Code Here

Examples of com.adito.plugin.PluginException

            CoreServlet.getServlet().getPolicyDatabase().registerResourceType(Sample.SAMPLE_RESOURCE_TYPE);
            Sample.SAMPLE_RESOURCE_TYPE.addPermission(PolicyConstants.PERM_CREATE_EDIT_AND_ASSIGN);
            Sample.SAMPLE_RESOURCE_TYPE.addPermission(PolicyConstants.PERM_EDIT_AND_ASSIGN);
            Sample.SAMPLE_RESOURCE_TYPE.addPermission(PolicyConstants.PERM_DELETE);
        } catch (Exception e) {
            throw new PluginException("Failed to register resource type.", e);
        }

        // Add the new items to the main menu
        MenuTree tree = NavigationManager.getMenuTree(CoreMenuTree.MENU_ITEM_MENU_TREE);
        tree.addMenuItem("resources", new MenuItem("userSamples", "sample", "/showUserSamples.do", 50, true, null,
                        SessionInfo.USER_CONSOLE_CONTEXT, null, null, Sample.SAMPLE_RESOURCE_TYPE));
        tree.addMenuItem("globalResources", new MenuItem("managementSamples", "sample", "/showSamples.do", 50, true, null,
                        SessionInfo.MANAGEMENT_CONSOLE_CONTEXT, Sample.SAMPLE_RESOURCE_TYPE, new Permission[] {
                                        PolicyConstants.PERM_CREATE_EDIT_AND_ASSIGN, PolicyConstants.PERM_EDIT_AND_ASSIGN,
                                        PolicyConstants.PERM_DELETE }, Sample.SAMPLE_RESOURCE_TYPE));

        // Add the new page tasks
        MenuTree pageTasks = NavigationManager.getMenuTree(PageTaskMenuTree.PAGE_TASK_MENU_TREE);
        pageTasks.addMenuItem(null, new MenuItem("showSamples", null, null, 100, false, SessionInfo.MANAGEMENT_CONSOLE_CONTEXT));
        pageTasks.addMenuItem("showSamples", new MenuItem("createSample", "sample", "/sampleDefaultDetails.do", 100, true, "_self",
                        SessionInfo.MANAGEMENT_CONSOLE_CONTEXT, Sample.SAMPLE_RESOURCE_TYPE,
                        new Permission[] { PolicyConstants.PERM_CREATE_EDIT_AND_ASSIGN }));

        // This demonstrates listening for events. In this case we will look for
        // 'sample created' events and display a message on the console
        CoreServlet.getServlet().addCoreListener(new CoreListener() {
            public void coreEvent(CoreEvent evt) {
                if (evt.getId() == SamplePlugin.EVT_SAMPLE_CREATED) {
                    System.err.println("****************************************");
                    System.err.println("* Someone just created a sample!!!     *");
                    System.err.println("****************************************");
                }
            }

        });

        /*
         * The following code demonstrates the registering user attribute
         * definitions. See the message resources for how to provide the
         * titles and descriptions for attributes and categories.
         */
        try {
            CoreServlet.getServlet().getUserDatabase().registerUserAttributeDefinition(
                            new UserAttributeDefinition(
                                  UserAttributeDefinition.TYPE_STRING,
                                  "sample1", "", 20000, "", "",
                                  UserAttributeDefinition.USER_OVERRIDABLE_ATTRIBUTE,
                                  10, "sample", false, "", "", true, true));
            CoreServlet.getServlet().getUserDatabase().registerUserAttributeDefinition(
                            new UserAttributeDefinition(
                                  UserAttributeDefinition.TYPE_STRING,
                                  "sample2", "", 20000, "", "",
                                  UserAttributeDefinition.USER_VIEWABLE_ATTRIBUTE,
                                  20, "sample", false, "Default Sample 2 Value", "", true, true));
            CoreServlet.getServlet().getUserDatabase().registerUserAttributeDefinition(
                            new UserAttributeDefinition(
                                  UserAttributeDefinition.TYPE_STRING,
                                  "sample3", "", 20001, "", "",
                                  UserAttributeDefinition.USER_OVERRIDABLE_ATTRIBUTE,
                                  20, "sample", false, "Default Sample 2 Value", "", true, true));
        }
        catch(Exception e) {
            throw new PluginException("Failed to register user attribute definitions.", e);
        }
    }
View Full Code Here

Examples of com.adito.plugin.PluginException

    public void initPlugin(PluginDefinition definition) throws PluginException {
        database = new SampleDatabase();
        try {
            database.open(CoreServlet.getServlet());
        } catch (Exception e) {
            throw new PluginException("Failed to open samples database.");
        }
    }
View Full Code Here

Examples of com.betfair.cougar.codegen.except.PluginException

    public void validate(Document doc) {
      try {
        doValidate(doc);
      }
        catch (Exception e) {
            throw new PluginException("Error validating document: " + e, e);
        }     
    }
View Full Code Here

Examples of com.dtolabs.rundeck.core.plugins.PluginException

    static void validateScriptPlugin(final ScriptPluginProvider plugin) throws PluginException {
        try {
            createDescription(plugin, true, DescriptionBuilder.builder());
        } catch (ConfigurationException e) {
            throw new PluginException(e);
        }
    }
View Full Code Here

Examples of com.ecyrd.jspwiki.plugin.PluginException

                        result[n] = pc.compile( ptrns[n] );
                    }
                }
                catch( MalformedPatternException e )
                {
                    throw new PluginException( "Parameter " + name + " has a malformed pattern: " + e.getMessage() );
                }
            }

            return result;
        }
View Full Code Here

Examples of edu.harvard.wcfia.yoshikoder.document.tokenizer.PluginException

                        return;
                    }
                }
                String mess =
                    Messages.getString("TokenizerPluginsPanel.metadataExtractionFailure");
                DialogUtil.yelp(yoshikoder, mess, new PluginException(mess));
            }
            protected void onSuccess() {
                listModel.addElement(tmd);
                list.setSelectedValue(tmd, true);
            }
View Full Code Here

Examples of grails.plugins.exceptions.PluginException

     */
    public void doRuntimeConfiguration(String pluginName, RuntimeSpringConfiguration springConfig) {
        checkInitialised();
        GrailsPlugin plugin = getGrailsPlugin(pluginName);
        if (plugin == null) {
            throw new PluginException("Plugin [" + pluginName + "] not found");
        }

        if (!plugin.supportsCurrentScopeAndEnvironment()) {
            return;
        }
View Full Code Here

Examples of mage.interfaces.PluginException

          prev = c.getGamesPlayed();
        }
      } catch (EOFException e) {
        // do nothing
      } catch (IOException e) {
        throw new PluginException(e);
      } catch (ClassNotFoundException e) {
        throw new PluginException(e);
      } finally {
        if (ois != null) try { ois.close(); } catch (Exception e) {}
      }
     
      try {
        synchronized (this) {
          oos = new ObjectOutputStream(new FileOutputStream(data));
          CounterBean c = new CounterBean();
          c.setGamesPlayed(prev+1);
          oos.writeObject(c);
          oos.close();
        }
      } catch (IOException e) {
        throw new PluginException(e);
      } finally {
        if (oos != null) try { oos.close(); } catch (Exception e) {}
      }
    } else {
      log.error("Counter plugin: data file doesn't exist, please restart plugin.");
View Full Code Here

Examples of net.pterodactylus.sone.freenet.plugin.PluginException

        replies.remove(pluginIdentifier);
      }
    }
    logger.log(Level.FINEST, String.format("Received FCP Response for %s: %s", fields.get("Message"), (reply.getFields() != null) ? reply.getFields().get("Message") : null));
    if ((reply.getFields() == null) || "Error".equals(reply.getFields().get("Message"))) {
      throw new PluginException("Could not perform request for " + fields.get("Message"));
    }
    return reply;
  }
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.