Package net.canarymod

Examples of net.canarymod.CanaryClassLoader.loadClass()


            try {
                PropertiesFile inf = new PropertiesFile(file.getAbsolutePath(), "Canary.inf");
                CanaryClassLoader ploader = new CanaryClassLoader(file.toURI().toURL(), DatabaseLoader.class.getClassLoader());
                String mainclass = inf.getString("main-class");
                String dbName = inf.getString("database-name");
                Class<?> dbClass = ploader.loadClass(mainclass);

                Database db = (Database) dbClass.newInstance();
                if (db != null) {
                    Database.Type.registerDatabase(dbName, db);
                }
View Full Code Here


                    return false;
                }
            }
            pluginInf.put(simpleMain(mainClass), inf);
            CanaryClassLoader ploader = new CanaryClassLoader(new File(inf.getString("jarPath")).toURI().toURL(), getClass().getClassLoader());
            Class<?> c = ploader.loadClass(mainClass);
            Plugin plugin = (Plugin) c.newInstance();
            plugin.setPriority(pluginPriorities.getInt(name, 0));
            synchronized (lock) {
                this.plugins.put(name, plugin);
            }
View Full Code Here

                File file = new File(plugin.getJarPath());
                PropertiesFile inf = new PropertiesFile(file.getAbsolutePath(), "Canary.inf");
                pluginInf.put(plugin.getClass().getSimpleName(), inf);
                if (testDependencies(plugin)) { // Test for changes
                    CanaryClassLoader ploader = new CanaryClassLoader(new File(inf.getString("jarPath")).toURI().toURL(), getClass().getClassLoader());
                    Class<?> cls = ploader.loadClass(inf.getString("main-class"));
                    plugin = (Plugin) cls.newInstance();
                    enabled = plugin.enable();
                    plugins.put(plugin.getName(), plugin);
                }
            }
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.