Examples of PluginLoader


Examples of org.graylog2.shared.plugins.PluginLoader

            logLevel = Level.DEBUG;
        }
        org.apache.log4j.Logger.getRootLogger().setLevel(logLevel);
        org.apache.log4j.Logger.getLogger(Main.class.getPackage().getName()).setLevel(logLevel);

        PluginLoader pluginLoader = new PluginLoader(new File(configuration.getPluginDir()));
        List<PluginModule> pluginModules = Lists.newArrayList();
        for (Plugin plugin : pluginLoader.loadPlugins())
            pluginModules.addAll(plugin.modules());

        LOG.debug("Loaded modules: " + pluginModules);

        final Injector injector = setupInjector(configuration, pluginModules);
View Full Code Here

Examples of org.openstreetmap.osmosis.core.plugin.PluginLoader

   *            the ClassLoader to use
   */
  @SuppressWarnings("unchecked")
  private void loadPluginClass(final String pluginClassName, final ClassLoader classLoader) {
    Class<?> untypedPluginClass;
    PluginLoader pluginLoader;
    Map<String, TaskManagerFactory> pluginTasks;
    // Load the plugin class.
    try {
      untypedPluginClass = classLoader.loadClass(pluginClassName);
    } catch (ClassNotFoundException e) {
      throw new OsmosisRuntimeException("Unable to load plugin class (" + pluginClassName + ").", e);
    }
    // Verify that the plugin implements the plugin loader interface.
    if (!PluginLoader.class.isAssignableFrom(untypedPluginClass)) {
      throw new OsmosisRuntimeException("The class (" + pluginClassName + ") does not implement interface ("
          + PluginLoader.class.getName() + "). Maybe it's not a plugin?");
    }
    Class<PluginLoader> pluginClass = (Class<PluginLoader>) untypedPluginClass;

    // Instantiate the plugin loader.
    try {
      pluginLoader = pluginClass.newInstance();
    } catch (InstantiationException e) {
      throw new IllegalArgumentException("Unable to instantiate plugin class (" + pluginClassName + ").", e);
    } catch (IllegalAccessException e) {
      throw new IllegalArgumentException("Unable to instantiate plugin class (" + pluginClassName + ").", e);
    }

    // Obtain the plugin task factories with their names.
    pluginTasks = pluginLoader.loadTaskFactories();

    // Register the plugin tasks.
    for (Entry<String, TaskManagerFactory> taskEntry : pluginTasks.entrySet()) {
      factoryRegister.register(taskEntry.getKey(), taskEntry.getValue());
    }
View Full Code Here

Examples of org.vosao.business.impl.plugin.PluginLoader

    resetPlugin(plugin);
  }
 
  public PluginLoader getPluginLoader() {
    if (pluginLoader == null) {
      pluginLoader = new PluginLoader(getDao(), getBusiness());
    }
    return pluginLoader;
  }
View Full Code Here

Examples of org.xmlBlaster.client.PluginLoader

    * the security plugin
    */
   public final PluginLoader getClientSecurityPluginLoader() {
      synchronized (PluginLoader.class) {
         if (clientSecurityLoader == null)
            clientSecurityLoader = new PluginLoader(this);
      }
      return clientSecurityLoader;
   }
View Full Code Here

Examples of ru.snake.spritepacker.plugin.PluginLoader

    JMenu pexport = new JMenu(Messages.getString("MainFrame.MENU_EXPORT")); //$NON-NLS-1$

    pimport.setMnemonic(KeyEvent.VK_I);
    pexport.setMnemonic(KeyEvent.VK_E);

    PluginLoader pluginLoader = new PluginLoader();
    Collection<String> errors = pluginLoader.loadPlugins();

    if (!errors.isEmpty()) {
      showPluginErrors(errors);
    }

    pexport.add(createMenuItem(EXPORT_ATLAS));
    pexport.add(createMenuItem(EXPORT_PROJECT));
    pexport.add(createMenuItem(EXPORT_ANIMATION));

    if (pluginLoader.hasExportPlugins()) {
      pexport.addSeparator();

      for (ExportPlugin plugin : pluginLoader.getExportPlugins()) {
        pexport.add(new ExportPlugunAction(this, factory, plugin));
      }
    }

    pimport.add(createMenuItem(IMPORT_ANIMATION));
    pimport.add(createMenuItem(IMPORT_TEXTURE));
    pimport.add(createMenuItem(IMPORT_TILED_TEXTURE));

    if (pluginLoader.hasImportPlugins()) {
      pimport.addSeparator();

      for (ImportPlugin plugin : pluginLoader.getImportPlugins()) {
        pimport.add(new ImportPlugunAction(this, factory, plugin));
      }
    }

    project.add(createMenuItem(NEW_PROJECT));
    project.add(createMenuItem(OPEN_PROJECT));
    project.add(createMenuItem(SAVE_PROJECT));
    project.add(createMenuItem(SAVE_PROJECT_AS));
    project.addSeparator();
    project.add(createMenuItem(VIEW_ATLAS));
    project.add(createMenuItem(SETTINGS_PROJECT));
    project.addSeparator();
    project.add(pexport);
    project.add(pimport);
    project.add(createMenuItem(SETTINGS_APPLICATION));
    project.addSeparator();
    project.add(createMenuItem(EXIT_APPLICATION));

    animation.add(createMenuItem(CREATE_ANIMATION));
    animation.add(createMenuItem(RENAME_ANIMATION));
    animation.add(createMenuItem(REMOVE_ANIMATION));
    animation.addSeparator();
    animation.add(createMenuItem(MOVE_ANIMATION_UP));
    animation.add(createMenuItem(MOVE_ANIMATION_DOWN));
    animation.addSeparator();
    animation.add(createMenuItem(ALIGN_ANIMATIONS));
    animation.add(createMenuItem(OFFSET_ANIMATION));
    animation.add(createMenuItem(CENTER_ANIMATION));

    sprite.add(createMenuItem(CREATE_SPRITE));
    sprite.add(createMenuItem(RENAME_SPRITE));
    sprite.add(createMenuItem(REMOVE_SPRITE));
    sprite.addSeparator();
    sprite.add(createMenuItem(MOVE_SPRITE_UP));
    sprite.add(createMenuItem(MOVE_SPRITE_DOWN));
    sprite.addSeparator();
    sprite.add(createMenuItem(OFFSET_SPRITE));
    sprite.add(createMenuItem(SPRITE_TEXTURE));

    texture.add(createMenuItem(MERGE_SIMILAR_TEXTURES));
    texture.add(createMenuItem(REMOVE_TEXTURE));

    if (pluginLoader.hasServicePlugins()) {
      JMenu plugins = new JMenu(
          Messages.getString("MainFrame.MENU_PLUGINS")); //$NON-NLS-1$)
      int index = menuBar.getComponentCount() - 1;

      for (ServicePlugin plugin : pluginLoader.getServicePlugins()) {
        plugins.add(new ServicePlugunAction(this, factory, plugin));
      }

      menuBar.add(plugins, index);
    }
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.