Package org.jasen.config

Examples of org.jasen.config.JasenPluginConfiguration


                JasenPlugin plugin = null;
                ProbabilityCalculator pluginCalc = null;
                PluginContainer container = null;
                Properties props = null;
                JasenPluginConfiguration pluginConfig = null;

                while(i.hasNext()) {
                    pluginConfig = (JasenPluginConfiguration)i.next();

                    plugin = (JasenPlugin)Class.forName(pluginConfig.getType(), true, loader).newInstance();

                    logger.debug("Initialising plugin: " + plugin.getClass().getName());

                    // initialise the plugin
                    if(pluginConfig.getProperties() != null) {
                        props = new Properties();
                        props.load(this.getClass().getClassLoader().getResourceAsStream(pluginConfig.getProperties()));
                    }
                    else {
                        props = null;
                    }

                    plugin.init(props);

                    if(pluginConfig.getCalculator() != null) {
                        pluginCalc = (ProbabilityCalculator)Class.forName(pluginConfig.getCalculator(), true, loader).newInstance();
                    }

                    // Add the plugin to a container
                    container = new PluginContainer();
                    container.setName(pluginConfig.getName());
                    container.setDisplayName(pluginConfig.getDisplayName());
                    container.setDescription(pluginConfig.getDescription());
                    container.setCalculator(pluginCalc);
                    container.setPlugin(plugin);

                    // Add the container to the list
                    plugins.add(container);
View Full Code Here

TOP

Related Classes of org.jasen.config.JasenPluginConfiguration

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.