Examples of PluginLoader


Examples of com.atolsystems.atolutilities.PlugInLoader

    public String getAboutMsg() {
        return "NimpSmartCard sample code: GetRandomData";
    }

    public static void invokeMain(String[] classFiles, String mainClassName, String[] classNames, String[] args) throws Throwable {
        PlugInLoader pl = new PlugInLoader(GetRandomData.class, "packageLocator");
        //System.out.println(AFileUtilities.getPackageUrl(GetRandomData.class, "packageLocator"));
        String here = AFileUtilities.getPackageUrl(GetRandomData.class, "packageLocator");
        String jarPrefix = "jar:file:/";
        int lastMarkPos=here.lastIndexOf("!");
        if(lastMarkPos!=-1){
            String jarFilePath = here.substring(jarPrefix.length(), lastMarkPos);
            //System.out.println("jar path:" + jarFilePath);
            pl.addJarFile(new File(jarFilePath));
        }else{
            //target class is not in a jar file, just assume the class is already known then
        }
        URL[] classUrls = new URL[classFiles.length];
        for (int i = 0; i < classFiles.length; i++) {
            classUrls[i] = ClassLoader.getSystemResource(classFiles[i]);
            //System.out.println("URL " + classUrls[i] + " added to classpath");
        }
        URLClassLoader ucl = new URLClassLoader(classUrls);
        for (int i = 0; i < classNames.length; i++) {
            //System.out.print("Loading " + classNames[i] + ": ");
            Class miscClass = null;
            try {
                miscClass = ucl.loadClass(classNames[i]);
            } catch (Throwable e) {
                //System.out.println("Class loading failed. Look in jar file: ");
                miscClass = pl.getPlugInClass(classNames[i]);
            }
            //System.out.println(miscClass + " loaded");
        }
        //System.out.print("Loading " + mainClassName + " as main class: ");
        Class c = null;
        try {
            c = ucl.loadClass(mainClassName);
        } catch (Throwable e) {
            //System.out.println("Class loading failed. Look in jar file: ");
            c = pl.getPlugInClass(mainClassName);
        }

        Method main = c.getDeclaredMethod("main", args.getClass());
        Object[] arguments = new Object[1];
        arguments[0] = args;
View Full Code Here

Examples of com.dotmarketing.plugin.PluginLoader

    Logger.info(this, "");

        String classPath = config.getServletContext().getRealPath("WEB-INF/lib");

      new PluginLoader().loadPlugins(config.getServletContext().getRealPath("."),classPath);




View Full Code Here

Examples of com.espertech.esper.plugin.PluginLoader

        List<ConfigurationPluginLoader> pluginLoaders = engine.getServices().getConfigSnapshot().getPluginLoaders();
        for (ConfigurationPluginLoader config : pluginLoaders// in the order configured
        {
            try
            {
                PluginLoader plugin = (PluginLoader) engine.getServices().getEngineEnvContext().lookup("plugin-loader/" + config.getLoaderName());
                plugin.postInitialize();
            }
            catch (Throwable t)
            {
                String message = "Error post-initializing plugin class " + config.getClassName() + ": " + t.getMessage();
                log.error(message, t);
View Full Code Here

Examples of com.espertech.esper.plugin.PluginLoader

            List<ConfigurationPluginLoader> pluginLoaders = engineToDestroy.getServices().getConfigSnapshot().getPluginLoaders();
            if (!pluginLoaders.isEmpty()) {
                List<ConfigurationPluginLoader> reversed = new ArrayList<ConfigurationPluginLoader>(pluginLoaders);
                Collections.reverse(reversed);
                for (ConfigurationPluginLoader config : reversed) {
                    PluginLoader plugin;
                    try {
                        plugin = (PluginLoader) engineToDestroy.getServices().getEngineEnvContext().lookup("plugin-loader/" + config.getLoaderName());
                        plugin.destroy();
                    }
                    catch (NamingException e) {
                        // expected
                    }
                    catch (RuntimeException e) {
View Full Code Here

Examples of com.espertech.esper.plugin.PluginLoader

            if (!(pluginLoaderObj instanceof PluginLoader)) {
                throw new ConfigurationException("Failed to cast adapter loader class '" + className + "' to " + PluginLoader.class.getName());
            }

            PluginLoader pluginLoader = (PluginLoader) pluginLoaderObj;
            PluginLoaderInitContext context = new PluginLoaderInitContext(config.getLoaderName(), config.getConfigProperties(), config.getConfigurationXML(), this);
            pluginLoader.init(context);

            // register adapter loader in JNDI context tree
            try
            {
                services.getEngineEnvContext().bind("plugin-loader/" + config.getLoaderName(), pluginLoader);
View Full Code Here

Examples of com.espertech.esper.plugin.PluginLoader

        List<ConfigurationPluginLoader> pluginLoaders = engine.getServices().getConfigSnapshot().getPluginLoaders();
        for (ConfigurationPluginLoader config : pluginLoaders// in the order configured
        {
            try
            {
                PluginLoader plugin = (PluginLoader) engine.getServices().getEngineEnvContext().lookup("plugin-loader/" + config.getLoaderName());
                plugin.postInitialize();
            }
            catch (Throwable t)
            {
                String message = "Error post-initializing plugin class " + config.getClassName() + ": " + t.getMessage();
                log.error(message, t);
View Full Code Here

Examples of com.espertech.esper.plugin.PluginLoader

            List<ConfigurationPluginLoader> pluginLoaders = engineToDestroy.getServices().getConfigSnapshot().getPluginLoaders();
            if (!pluginLoaders.isEmpty()) {
                List<ConfigurationPluginLoader> reversed = new ArrayList<ConfigurationPluginLoader>(pluginLoaders);
                Collections.reverse(reversed);
                for (ConfigurationPluginLoader config : reversed) {
                    PluginLoader plugin;
                    try {
                        plugin = (PluginLoader) engineToDestroy.getServices().getEngineEnvContext().lookup("plugin-loader/" + config.getLoaderName());
                        plugin.destroy();
                    }
                    catch (NamingException e) {
                        // expected
                    }
                    catch (RuntimeException e) {
View Full Code Here

Examples of com.espertech.esper.plugin.PluginLoader

            if (!(pluginLoaderObj instanceof PluginLoader)) {
                throw new ConfigurationException("Failed to cast adapter loader class '" + className + "' to " + PluginLoader.class.getName());
            }

            PluginLoader pluginLoader = (PluginLoader) pluginLoaderObj;
            PluginLoaderInitContext context = new PluginLoaderInitContext(config.getLoaderName(), config.getConfigProperties(), config.getConfigurationXML(), this);
            pluginLoader.init(context);

            // register adapter loader in JNDI context tree
            try
            {
                services.getEngineEnvContext().bind("plugin-loader/" + config.getLoaderName(), pluginLoader);
View Full Code Here

Examples of com.espertech.esper.plugin.PluginLoader

        List<ConfigurationPluginLoader> pluginLoaders = engine.getServices().getConfigSnapshot().getPluginLoaders();
        for (ConfigurationPluginLoader config : pluginLoaders// in the order configured
        {
            try
            {
                PluginLoader plugin = (PluginLoader) engine.getServices().getEngineEnvContext().lookup("plugin-loader/" + config.getLoaderName());
                plugin.postInitialize();
            }
            catch (Throwable t)
            {
                String message = "Error post-initializing plugin class " + config.getClassName() + ": " + t.getMessage();
                log.error(message, t);
View Full Code Here

Examples of com.espertech.esper.plugin.PluginLoader

            List<ConfigurationPluginLoader> pluginLoaders = engineToDestroy.getServices().getConfigSnapshot().getPluginLoaders();
            if (!pluginLoaders.isEmpty()) {
                List<ConfigurationPluginLoader> reversed = new ArrayList<ConfigurationPluginLoader>(pluginLoaders);
                Collections.reverse(reversed);
                for (ConfigurationPluginLoader config : reversed) {
                    PluginLoader plugin;
                    try {
                        plugin = (PluginLoader) engineToDestroy.getServices().getEngineEnvContext().lookup("plugin-loader/" + config.getLoaderName());
                        plugin.destroy();
                    }
                    catch (NamingException e) {
                        // expected
                    }
                    catch (RuntimeException e) {
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.