Package org.java.plugin.registry

Examples of org.java.plugin.registry.PluginDescriptor


                NameAndVersion nameAndVersion = new NameAndVersion(nav[0], vn, true,
                        file);
                for (Iterator<String> it = urls.keySet().iterator(); it.hasNext();) {
                    String loc = it.next();
                    if (loc.indexOf(nav[0]) >= 0) {
                        PluginDescriptor desc = urls.get(loc);
                        //System.out.println("Accounted for: "+desc.getId()+" "+desc.getVersion().toString());
                        if (!PluginCore.getManager().isPluginEnabled(urls.get(loc)))
                            nameAndVersion.setStatus(BAD);
                        else
                            nameAndVersion.setStatus(LOADED);
                        it.remove();
                    }
                }
                plugins.add(nameAndVersion);
            }
        }

        for (String url : urls.keySet()) {
            PluginDescriptor desc = urls.get(url);
            File location =  new File(desc.getLocation().getFile());
            if (location.getPath().indexOf(PluginCore.userPluginDir.getPath()) >= 0)
                continue; // This must be a loaded user dir plugin that's been deleted.
            //System.out.println("File: "+desc.getLocation().getFile());
            NameAndVersion nameAndVersion = new NameAndVersion(desc.getId(),
                    new VersionNumber(desc.getVersion().toString()), false,
                   location);
            if (!PluginCore.getManager().isPluginEnabled(urls.get(url)))
                nameAndVersion.setStatus(BAD);
            else
                nameAndVersion.setStatus(LOADED);
View Full Code Here


          ret.putAll(this.getDefaultAlgorithms());
         
          // we assume the plugins are already published at UnBBayesFrame#loadPlugins(), so, we do not have to republish them.

          // loads the "core" plugin, which declares general extension points for core (including algorithms)
          PluginDescriptor core = this.getPluginManager().getRegistry().getPluginDescriptor(this.getPluginCoreID());
           
          // load the extension point for new algorithms (functionalities).
          ExtensionPoint point = this.getPluginManager().getRegistry().getExtensionPoint(core.getId(), this.getAlgorithmExtensionPoint());
         
          // iterate over the connected extension points
          for (Iterator<Extension> it = point.getConnectedExtensions().iterator(); it.hasNext();) {
          try {
            Extension ext = it.next();
                  PluginDescriptor descr = ext.getDeclaringPluginDescriptor();
                 
                  this.getPluginManager().activatePlugin(descr.getId());
           
            // extracting parameters
            Parameter classParam = ext.getParameter(PluginCore.PARAMETER_CLASS);
           
            // extracting plugin class or builder clas
View Full Code Here

    ExtensionPoint fhExt = PluginCore.getManager().getRegistry().getExtensionPoint(CORE_PLUGIN_ID, EXTENSION_ID);
    for (Extension e : fhExt.getConnectedExtensions()) {
      String pluginClassName = "";
      try {
       
        PluginDescriptor extensionDescriptor = e.getDeclaringPluginDescriptor();
        pluginClassName = e.getParameter("class").valueAsString();
        ClassLoader classLoader = PluginCore.getManager().getPluginClassLoader(extensionDescriptor);
        PluginCore.getManager().activatePlugin(extensionDescriptor.getId());
        Class<FiletypeHandler>pluginClass = (Class<FiletypeHandler>) classLoader.loadClass(pluginClassName);
        FiletypeHandler pluginInstance = pluginClass.newInstance();
        FiletypeHandler.register(pluginInstance);
        pluginInstance.desc = e;
        String fhName = e.getParameter("name").valueAsString();
View Full Code Here

     *
     * @param local Local path to resource
     * @return Absolute URL to resource
     */
    public static URL getResourceURL(String local) {
        PluginDescriptor myPlugin = PluginCore.getManager().getRegistry().getPluginDescriptor("org.alastairmailer.luceneplugin");
        return PluginCore.getManager().getPathResolver().resolvePath(myPlugin, local);
    }
View Full Code Here

    registerJpfPlugins(pluginManager, locations);
   
    // Initialise all of the plugins that have been registered.
    LOG.fine("Activating the plugins.");
    // load plugins for the task-extension-point
    PluginDescriptor core = pluginManager.getRegistry()
        .getPluginDescriptor("org.openstreetmap.osmosis.core.plugin.Core");

    ExtensionPoint point = pluginManager.getRegistry().getExtensionPoint(core.getId(), "Task");
    for (Iterator<Extension> it = point.getConnectedExtensions().iterator(); it.hasNext();) {

      Extension ext = it.next();
      PluginDescriptor descr = ext.getDeclaringPluginDescriptor();
      try {
        pluginManager.enablePlugin(descr, true);
        pluginManager.activatePlugin(descr.getId());
        ClassLoader classLoader = pluginManager.getPluginClassLoader(descr);
        loadPluginClass(ext.getParameter("class").valueAsString(), classLoader);
      } catch (PluginLifecycleException e) {
        throw new OsmosisRuntimeException("Cannot load JPF-plugin '" + ext.getId()
            + "' for extensionpoint '" + ext.getExtendedPointId() + "'", e);
View Full Code Here

   *            The plugin manager to register the plugin with.
   */
  private void registerCorePlugin(PluginManager pluginManager) {
    try {
      URL core;
      PluginDescriptor coreDescriptor;
     
      // Get the plugin configuration file.
      core = getClass().getResource("/org/openstreetmap/osmosis/core/plugin/plugin.xml");
      LOG.finest("Plugin URL: " + core);
     
View Full Code Here

TOP

Related Classes of org.java.plugin.registry.PluginDescriptor

Copyright © 2018 www.massapicom. 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.