Examples of PluginManager


Examples of org.java.plugin.PluginManager

        Logger log = Logger.getLogger(PluginCore.class.getName());

        ObjectFactory objectFactory = ObjectFactory.newInstance();

        PluginManager result = objectFactory.createManager();

       
        /*
         * Now find plug-ins! Check directories and jar.
         */
        try {
            DefaultPluginsCollector collector = new DefaultPluginsCollector();
            ExtendedProperties ep = new ExtendedProperties();


            List<File> directoriesToSearch = new LinkedList<File>();
            directoriesToSearch.add(new File("./src/plugins"));
            directoriesToSearch.add(new File("./plugins"));
            directoriesToSearch.add(userPluginDir);

            try {
                File parent = new File(PluginCore.class.getProtectionDomain()
                    .getCodeSource().getLocation().toURI()).getParentFile();
           
                if (!parent.getCanonicalFile().equals(
                    new File(".").getCanonicalFile())) {
                    directoriesToSearch.add(new File(parent, "/src/plugins"));
                    directoriesToSearch.add(new File(parent, "/plugins"));
                }
            } catch (Exception e) {
                // no problem, we just use paths relative to current dir.
            }

            StringBuilder sb = new StringBuilder();
            for (File directory : directoriesToSearch) {
                // We don't want warnings if the default plug-in paths don't
                // exist, we do that below
                if (directory.exists()) {
                    if (sb.length() > 0)
                        sb.append(',');
                    sb.append(directory.getPath());
                }
            }

            ep.setProperty("org.java.plugin.boot.pluginsRepositories", sb
                .toString());
            collector.configure(ep);

            Collection<PluginLocation> plugins = collector
                .collectPluginLocations();

            /**
             * I know the following is really, really ugly, but I have found no
             * way to automatically discover multiple plugin.xmls in JARs
             */
            String[] jarLocationsToSearch = new String[] {
                "/plugins/net.sf.jabref.core/",
                "/plugins/net.sf.jabref.export.misq/"};
               
            // Collection locations
            for (String jarLocation : jarLocationsToSearch) {
                PluginLocation location = getLocationInsideJar(jarLocation,
                    "plugin.xml");
                if (location != null)
                    plugins.add(location);
            }

            if (plugins.size() <= 0) {
                log
                    .warning(Globals
                        .lang("No plugins were found in the following folders:") +
                        "\n  " +
                        Util.join(directoriesToSearch
                            .toArray(new String[directoriesToSearch.size()]),
                            "\n  ", 0, directoriesToSearch.size()) +
                        "\n" +
                        Globals.lang("and inside the JabRef-jar:") +
                        "\n  " +
                        Util.join(jarLocationsToSearch, "\n  ", 0,
                            jarLocationsToSearch.length) +
                        "\n" +
                        Globals
                            .lang("At least the plug-in 'net.sf.jabref.core' should be there."));
            } else {
                result.publishPlugins(plugins.toArray(new PluginLocation[] {}));

                Collection<PluginDescriptor> descs = result.getRegistry()
                    .getPluginDescriptors();

                sb = new StringBuilder();
                sb.append(Globals.lang("Found %0 plugin(s)", String
                    .valueOf(descs.size())) +
                    ":\n");

                for (PluginDescriptor p : result.getRegistry()
                    .getPluginDescriptors()) {
                    sb.append("  - ").append(p.getId()).append(" (").append(
                        p.getLocation()).append(")\n");
                }
                log.info(sb.toString());
View Full Code Here

Examples of org.jivesoftware.openfire.container.PluginManager

        if (isSocketStarted || sessionManager == null || deliverer == null || router == null || serverName == null) {
            return;
        }

        // Check if plugins have been loaded
        PluginManager pluginManager = XMPPServer.getInstance().getPluginManager();
        if (!pluginManager.isExecuted()) {
            pluginManager.addPluginManagerListener(new PluginManagerListener() {
                public void pluginsMonitored() {
                    // Stop listening for plugin events
                    XMPPServer.getInstance().getPluginManager().removePluginManagerListener(this);
                    // Start listeners
                    startListeners();
View Full Code Here

Examples of org.jnode.plugin.PluginManager

 
    @Override
    public void doComplete(CompletionInfo completions, String partial, int flags) {
        try {
            // get the plugin manager
            final PluginManager piMgr = InitialNaming.lookup(PluginManager.NAME);

            // collect matching plugin id's
            for (PluginDescriptor descr : piMgr.getRegistry()) {
                final String id = descr.getId();
                if (id.startsWith(partial)) {
                    completions.addCompletion(id);
                }
            }
View Full Code Here

Examples of org.joget.plugin.base.PluginManager

    public String getPropertyOptions() {
        return AppUtil.readPluginResource(getClass().getName(), "/properties/datalist/textFieldDataListFilterType.json", null, true, null);
    }

    public String getTemplate(DataList datalist, String name, String label) {
        PluginManager pluginManager = (PluginManager) AppUtil.getApplicationContext().getBean("pluginManager");
        Map dataModel = new HashMap();
        dataModel.put("name", datalist.getDataListEncodedParamName(DataList.PARAMETER_FILTER_PREFIX+name));
        dataModel.put("label", label);
        dataModel.put("value", getValue(datalist, name, getPropertyString("defaultValue")));
        dataModel.put("contextPath", WorkflowUtil.getHttpServletRequest().getContextPath());
        return pluginManager.getPluginFreeMarkerTemplate(dataModel, getClassName(), "/templates/textFieldDataListFilterType.ftl", null);
    }
View Full Code Here

Examples of org.jpox.plugin.PluginManager

        // Use JDOClassLoaderResolver here since we need the plugin mechanism before being able to create our specified CLR
        ClassLoaderResolver clr = new JDOClassLoaderResolver(this.getClass().getClassLoader());
        clr.registerUserClassLoader((ClassLoader)persistenceConfig.getProperty("org.jpox.primaryClassLoader"));

        // Instantiate manager for the plugins
        this.pluginManager = new PluginManager(this.persistenceConfig, clr);
        this.pluginManager.registerExtensionPoints();
        this.pluginManager.registerExtensions();
        this.pluginManager.resolveConstraints();

        // Load up any default properties from the plugins
View Full Code Here

Examples of org.objectweb.celtix.plugins.PluginManager

        public Object getPlugin() {
            return plugin;
        }

        public void run() {
            PluginManager pm = Application.getInstance().getPluginManager();
            try {
                plugin = pm.getPlugin(className);
            } catch (PluginException ex) {
                // ignore
            }
        }
View Full Code Here

Examples of org.rhq.core.pc.plugin.PluginManager

    @BeforeMethod
    public void initTest() throws Exception {
        tmpDir = mkdir(basedir(), "tmp");

        pcConfig = new PluginContainerConfiguration();
        pluginManager = new PluginManager(pcConfig, new PluginLifecycleListenerManagerImpl());
        ServerServices serverServices = new ServerServices();
        driftServerService = new TestDriftServerService();
        serverServices.setDriftServerService(driftServerService);
        pcConfig.setServerServices(serverServices);
        pcConfig.setDataDirectory(basedir());
View Full Code Here

Examples of org.socialmusicdiscovery.server.business.logic.PluginManager

            while (pluginIterator.hasNext()) {
                Plugin plugin = pluginIterator.next();
                plugins.put(plugin.getId(), plugin);
            }

            pluginManager = new PluginManager(plugins);
        }
        return pluginManager;
    }
View Full Code Here

Examples of org.tuba.plugins.util.PluginManager

   * @throws IntegrationException
   */
  private boolean prepareIntegration(XMLReference reference)
      throws IntegrationException {
    boolean hasChanged = false;
    PluginManager pluginManager = PluginManager.getInstance();
    List<XMLArtefactOperation> operations = reference.getOperations();
   
    XMLProvider xmlProvider = reference.getProvider();
    if (xmlProvider == null) {
      // TODO externalize
      String message = "there is no provider"; //$NON-NLS-1$
      showError(message);
      throw new MissingProviderException();
    }
    String id = xmlProvider.getId();
    MetaProvider provider = pluginManager.getProvider(id);
    if (provider == null) {
      // TODO externalize
      String message = "can't insantiate provider '" + id + "'"; //$NON-NLS-1$ //$NON-NLS-2$
      showError(message);
      throw new MissingProviderException(id);
    }

    String firstArtefactType = provider.getProvidedArtefactType();
    checkOperationOrder(firstArtefactType, operations);

    String lastRepresentationType = firstArtefactType;
    if (!operations.isEmpty()) {
      id = operations.get(operations.size() - 1).getId();
      lastRepresentationType = pluginManager.getArtefactOperation(id)
          .getTargetType();
    }

    XMLIntegrator integrator = reference.getIntegrator();
    if (integrator == null
View Full Code Here

Examples of org.xmlBlaster.authentication.plugins.PluginManager

      if (log.isLoggable(Level.FINER)) log.finer("Entering constructor");
      /*this.encapsulator = */new AuthenticateProtector(glob, this); // my security layer (delegate)

      glob.getRunlevelManager().addRunlevelListener(this);

      plgnLdr = new PluginManager(global);
      plgnLdr.init(this);
      xmlBlasterImpl = new XmlBlasterImpl(this);
     
      // TODO: Decide by authorizer, see SessionInfo.java with specific setting
      this.acceptWrongSenderAddress = glob.getProperty().get("xmlBlaster/acceptWrongSenderAddress", 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.