Package net.xeoh.plugins.base

Examples of net.xeoh.plugins.base.Pluggable


        // Needed to query some special information
        final PluginManagerImpl pmi = (PluginManagerImpl) this.pluginManager;

        // To handle annotations, we need to obtain the true class
        final Pluggable pluggable = (_plugin instanceof PluginWrapper) ? ((PluginWrapper) _plugin).getWrappedPlugin() : _plugin;

        // Prepare return values ...
        final Collection<String> rval = new ArrayList<String>();

        switch (item) {

        case CAPABILITIES:
            // Caps are only supported for plugins currently
            final String[] caps = getCaps(pluggable);
            for (final String string : caps) {
                rval.add(string);
            }
            break;

        case AUTHORS:
            Author author = pluggable.getClass().getAnnotation(Author.class);
            if (author == null) break;
            rval.add(author.name());
            break;

        case VERSION:
            Version version = pluggable.getClass().getAnnotation(Version.class);
            if (version == null) break;
            rval.add(Integer.toString(version.version()));
            break;

        case CLASSPATH_ORIGIN:
View Full Code Here


        try {
            // Schedule late message. (TODO: Make this configurable)
            timer.schedule(lateMessage, 250);

            // Instanciate the plugin
            final Pluggable spawnedPlugin = (Pluggable) c.newInstance();

            // Detect type
            SpawnType type = null;

            if (Pluglet.class.isAssignableFrom(c)) {
View Full Code Here

     * @param spawnResult The parameter you passed.
     * @return .
     */
    public SpawnResult continueSpawn(SpawnResult spawnResult) {

        final Pluggable spawnedPlugin = spawnResult.pluggable;
        final Class<? extends Pluggable> c = spawnedPlugin.getClass();

        // Finally load and register plugin
        try {
            // 1. Inject all variables
            injectVariables(spawnedPlugin);
View Full Code Here

TOP

Related Classes of net.xeoh.plugins.base.Pluggable

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.