Examples of PluginRegistry


Examples of com.addthis.codec.plugins.PluginRegistry

    private final Config         globalConfig;
    private final PluginRegistry pluginRegistry;
    private final ConcurrentMap<Class<?>, CodableClassInfo> fieldMaps = new ConcurrentHashMap<>();

    public CodecConfig(Config globalConfig) {
        this(globalConfig, new PluginRegistry(globalConfig));
    }
View Full Code Here

Examples of com.gitblit.models.PluginRegistry

    if (files == null || files.length == 0) {
      return list;
    }

    for (File file : files) {
      PluginRegistry registry = null;
      try {
        String json = FileUtils.readContent(file, "\n");
        registry = JsonUtils.fromJsonString(json, PluginRegistry.class);
        registry.setup();
      } catch (Exception e) {
        logger.error("Failed to deserialize " + file, e);
      }
      if (registry != null) {
        list.add(registry);
View Full Code Here

Examples of com.gitblit.models.PluginRegistry

    if (files == null || files.length == 0) {
      return list;
    }

    for (File file : files) {
      PluginRegistry registry = null;
      try {
        String json = FileUtils.readContent(file, "\n");
        registry = JsonUtils.fromJsonString(json, PluginRegistry.class);
        registry.setup();
      } catch (Exception e) {
        logger.error("Failed to deserialize " + file, e);
      }
      if (registry != null) {
        list.add(registry);
View Full Code Here

Examples of com.salesforce.omakase.PluginRegistry

                writer.writeComments(true, true);
            }

            // do the parsing
            CssErrorManager em = new CssErrorManager(resourceName);
            PluginRegistry registry = Omakase.source(content).add(plugins).add(writer).add(em).process();

            // report any errors found during parsing
            em.checkErrors();

            // return the results
            ParserResult result = new ParserResult();
            result.content = writer.write();

            if (registry.retrieve(ThemeFunctionPlugin.class).isPresent()) {
                result.themeExpressions = registry.retrieve(ThemeFunctionPlugin.class).get().parsedExpressions();
            }

            return result;
        }
View Full Code Here

Examples of net.sourceforge.cruisecontrol.PluginRegistry

        }
    }

    private static Map getPluginDefaults(final Element elementToAlter) {

        final PluginRegistry pluginsRegistry = PluginRegistry.createRegistry();
        final Map pluginDefaults = new HashMap();
        // note: the map returned here is "unmodifiable"
        pluginDefaults.putAll(pluginsRegistry.getDefaultProperties(elementToAlter.getName()));

        if (pluginDefaults.size() == 0) { // maybe we're in a unit test
            // @todo Remove this kludge when we figure out how to make PluginRegistry work in unit test
            LOG.warn("Unit Test kludge for plugin default values. "
                    + "Should happen only if no default plugin settings exist OR during unit tests.");
View Full Code Here

Examples of net.sourceforge.cruisecontrol.PluginRegistry

                getAgentPropertiesFilename());

        final String overrideTarget = projectProperties.getProperty(PropertiesHelper.DISTRIBUTED_OVERRIDE_TARGET);
        PluginXMLHelper pluginXMLHelper = PropertiesHelper.createPluginXMLHelper(overrideTarget);

        PluginRegistry plugins = PluginRegistry.createRegistry();
        Class pluginClass = plugins.getPluginClass(builderElement.getName());
        final Builder builder = (Builder) pluginXMLHelper.configure(builderElement, pluginClass, false);

        return builder;
    }
View Full Code Here

Examples of net.xeoh.plugins.base.impl.registry.PluginRegistry

                rval.add("jspf.build:" + build);
            }
            break;

        case CLASSPATH_ORIGIN:
            final PluginRegistry pluginRegistry = pmi.getPluginRegistry();
            final PluginMetaInformation metaInformation = pluginRegistry.getMetaInformationFor(plugin);
            if (metaInformation != null && metaInformation.classMeta != null && metaInformation.classMeta.pluginOrigin != null)
                    rval.add(metaInformation.classMeta.pluginOrigin.toString());
            break;

        default:
View Full Code Here

Examples of net.xeoh.plugins.base.impl.registry.PluginRegistry

        this.logger.finest("Trying to load " + name + " as a plugin.");

        // Obtain some shared objects
        // final JARCache jarCache = this.pluginManager.getJARCache();
        final ClassPathManager classPathManager = this.pluginManager.getClassPathManager();
        final PluginRegistry pluginRegistry = this.pluginManager.getPluginRegistry();
        final PluginConfigurationUtil pcu = new PluginConfigurationUtil(this.pluginManager.getPluginConfiguration());
        final Spawner spawner = this.pluginManager.getSpawner();

        // Obtain information
        // final JARInformation jarInformation = jarCache.getJARInformation(name);
        // final String file = jarCache.classTofile(name);

        try {
            // Get class of the candidate
            final Class<?> possiblePlugin = classPathManager.loadClass(location, name);

            // Don't load plugins already spawned.
            if (name.startsWith("net.xeoh.plugins.base") ||
                name.startsWith("net.xeoh.plugins.diagnosis.") ||
                name.startsWith("net.xeoh.plugins.informationbroker.")) return;
           
            // Get the plugin's annotation
            final PluginImplementation annotation = possiblePlugin.getAnnotation(PluginImplementation.class);

            // Nothing to load here if no annotation is present
            if (annotation == null) { return; }


           
            // Don't load classes already loaded from this location
            final PluginClassMetaInformation preexistingMeta = pluginRegistry.getMetaInformationFor((Class<? extends Plugin>) possiblePlugin);
            if (preexistingMeta != null) {
                this.logger.info("Skipping plugin " + possiblePlugin + " because we already have it ");
                return;
            }

           
            // Register class at registry
            final PluginClassMetaInformation metaInformation = new PluginClassMetaInformation();
            metaInformation.pluginClassStatus = PluginClassStatus.ACCEPTED;
            if (location != null) {
                metaInformation.pluginOrigin = location.getToplevelLocation();
            } else {
                metaInformation.pluginOrigin = new URI("classpath://UNDEFINED");
            }
            pluginRegistry.registerPluginClass((Class<? extends Plugin>) possiblePlugin, metaInformation);

            // Update the class information of the corresponding cache entry
            this.logger.finer("Updating cache information");

            // Avoid loading if annotation request it.
View Full Code Here

Examples of net.xeoh.plugins.base.impl.registry.PluginRegistry

     */
    @SuppressWarnings({ "unchecked", "rawtypes" })
    protected void processPending() {

        // Obtain shared objects
        final PluginRegistry pluginRegistry = this.pluginManager.getPluginRegistry();
        final Spawner spawner = this.pluginManager.getSpawner();

        // All classes we want to spawn
        final Collection<Class<? extends Plugin>> toSpawn = new ArrayList<Class<? extends Plugin>>();
        toSpawn.addAll(pluginRegistry.getPluginClassesWithStatus(PluginClassStatus.CONTAINS_UNRESOLVED_DEPENDENCIES));
        toSpawn.addAll(pluginRegistry.getPluginClassesWithStatus(PluginClassStatus.SPAWNABLE));

        // Check if there is work to do.
        if (toSpawn.size() == 0) return;

        boolean loopAgain;

        do {
            // Classes we want to spawn
            final Collection<Class<? extends Plugin>> spawned = new ArrayList<Class<? extends Plugin>>();

            // Reset hasLoaded flag
            loopAgain = false;

            // Check all known classes ...
            for (final Class c : toSpawn) {
                this.logger.fine("Trying to load pending " + c);

                final PluginClassMetaInformation metaInformation = pluginRegistry.getMetaInformationFor(c);

                // If the class is spawnable, spawn it ...
                if (metaInformation.pluginClassStatus == PluginClassStatus.SPAWNABLE) {
                    this.logger.fine("Class found as SPAWNABLE. Trying to spawn it now " + c);

View Full Code Here

Examples of net.xeoh.plugins.base.impl.registry.PluginRegistry

        this.logger.finest("Trying to load " + name + " as a plugin.");

        // Obtain some shared objects
        // final JARCache jarCache = this.pluginManager.getJARCache();
        final ClassPathManager classPathManager = this.pluginManager.getClassPathManager();
        final PluginRegistry pluginRegistry = this.pluginManager.getPluginRegistry();
        final PluginConfigurationUtil pcu = new PluginConfigurationUtil(this.pluginManager.getPluginConfiguration());
        final Spawner spawner = this.pluginManager.getSpawner();

        // Obtain information
        // final JARInformation jarInformation = jarCache.getJARInformation(name);
        // final String file = jarCache.classTofile(name);

        try {
            // Get class of the candidate
            final Class<?> possiblePlugin = classPathManager.loadClass(location, name);

            // Don't load plugins already spawned.
            if (name.startsWith("net.xeoh.plugins.base") ||
                name.startsWith("net.xeoh.plugins.diagnosis.") ||
                name.startsWith("net.xeoh.plugins.informationbroker.")) return;
           
            // Get the plugin's annotation
            final PluginImplementation annotation = possiblePlugin.getAnnotation(PluginImplementation.class);

            // Nothing to load here if no annotation is present
            if (annotation == null) { return; }


           
            // Don't load classes already loaded from this location
            final PluginClassMetaInformation preexistingMeta = pluginRegistry.getMetaInformationFor((Class<? extends Plugin>) possiblePlugin);
            if (preexistingMeta != null) {
                this.logger.info("Skipping plugin " + possiblePlugin + " because we already have it ");
                return;
            }

           
            // Register class at registry
            final PluginClassMetaInformation metaInformation = new PluginClassMetaInformation();
            metaInformation.pluginClassStatus = PluginClassStatus.ACCEPTED;
            if (location != null) {
                metaInformation.pluginOrigin = location.getToplevelLocation();
            } else {
                metaInformation.pluginOrigin = new URI("classpath://UNDEFINED");
            }
            pluginRegistry.registerPluginClass((Class<? extends Plugin>) possiblePlugin, metaInformation);

            // Update the class information of the corresponding cache entry
            this.logger.finer("Updating cache information");

            // Avoid loading if annotation request it.
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.