Examples of PluginExecutionException


Examples of org.jboss.forge.shell.exceptions.PluginExecutionException

            if (command != null)
            {
               if (!command.usableWithResource(shell.getCurrentResource().getClass()))
               {
                  // noinspection unchecked
                  throw new PluginExecutionException(plugin, "command '"
                           + command.getName()
                           + "' is not usable in current scope ["
                           + shell.getCurrentResource().getClass().getSimpleName()
                           + "]"
                           + " -- usable scopes: "
                           + GeneralUtils.elementSetSimpleTypesToString((Set) command.getResourceScopes()));
               }

               execution.setCommand(command);

               // parse parameters and set order / nulls for command invocation

               Object[] parameters = parseParameters(command, tokens, pipeIn, pipeOut);
               execution.setParameterArray(parameters);
            }
            else
            {
               throw new PluginExecutionException(plugin, "Missing command for plugin [" + plugin.getName()
                        + "], available commands: " + plugin.getCommands(shell));
            }
         }
         else
         {
            List<PluginMetadata> pluginMetadata = registry.getPluginMetadata(first);
            if ((pluginMetadata != null) && !pluginMetadata.isEmpty())
            {
               Set<Class<? extends Resource<?>>> aggregate = new HashSet<Class<? extends Resource<?>>>();
               for (PluginMetadata meta : pluginMetadata)
               {
                  Set<Class<? extends Resource<?>>> scopes = meta.getResourceScopes();
                  aggregate.addAll(scopes);
               }

               throw new PluginExecutionException(pluginMetadata.get(0),
                        "Plugin is not usable in current scope or project.");
            }
         }
      }
View Full Code Here

Examples of org.jboss.forge.shell.exceptions.PluginExecutionException

            if (command != null)
            {
               if (!command.usableWithResource(shell.getCurrentResource().getClass()))
               {
                  // noinspection unchecked
                  throw new PluginExecutionException(plugin, "command '"
                           + command.getName()
                           + "' is not usable in current scope ["
                           + shell.getCurrentResource().getClass().getSimpleName()
                           + "]"
                           + " -- usable scopes: "
                           + GeneralUtils.elementSetSimpleTypesToString((Set) command.getResourceScopes()));
               }

               execution.setCommand(command);

               // parse parameters and set order / nulls for command invocation

               Object[] parameters = parseParameters(command, tokens, pipeIn, pipeOut);
               execution.setParameterArray(parameters);
            }
            else
            {
               throw new PluginExecutionException(plugin, "Missing command for plugin [" + plugin.getName()
                        + "], available commands: " + plugin.getCommands(shell));
            }
         }
         else
         {
            List<PluginMetadata> pluginMetadata = registry.getPluginMetadata(first);
            if ((pluginMetadata != null) && !pluginMetadata.isEmpty())
            {
               Set<Class<? extends Resource<?>>> aggregate = new HashSet<Class<? extends Resource<?>>>();
               for (PluginMetadata meta : pluginMetadata)
               {
                  Set<Class<? extends Resource<?>>> scopes = meta.getResourceScopes();
                  aggregate.addAll(scopes);
               }

               throw new PluginExecutionException(pluginMetadata.get(0),
                        "Plugin is not usable in current scope or project.");
            }
         }
      }
View Full Code Here

Examples of org.jboss.forge.shell.exceptions.PluginExecutionException

            if (command != null)
            {
               if (!command.usableWithResource(shell.getCurrentResource().getClass()))
               {
                  // noinspection unchecked
                  throw new PluginExecutionException(plugin, "command '"
                           + command.getName()
                           + "' is not usable in current scope ["
                           + shell.getCurrentResource().getClass().getSimpleName()
                           + "]"
                           + " -- usable scopes: "
                           + GeneralUtils.elementSetSimpleTypesToString((Set) command.getResourceScopes()));
               }

               execution.setCommand(command);

               // parse parameters and set order / nulls for command invocation

               Object[] parameters = parseParameters(command, tokens, pipeIn, pipeOut);
               execution.setParameterArray(parameters);
            }
            else
            {
               throw new PluginExecutionException(plugin, "Missing command for plugin [" + plugin.getName()
                        + "], available commands: " + plugin.getCommands(shell));
            }
         }
         else
         {
            List<PluginMetadata> pluginMetadata = registry.getPluginMetadata(first);
            if ((pluginMetadata != null) && !pluginMetadata.isEmpty())
            {
               Set<Class<? extends Resource<?>>> aggregate = new HashSet<Class<? extends Resource<?>>>();
               for (PluginMetadata meta : pluginMetadata)
               {
                  Set<Class<? extends Resource<?>>> scopes = meta.getResourceScopes();
                  aggregate.addAll(scopes);
               }

               throw new PluginExecutionException(pluginMetadata.get(0),
                        "Plugin is not usable in current scope or project.");
            }
         }
      }
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.