Package org.apache.geronimo.system.plugin

Examples of org.apache.geronimo.system.plugin.PluginInstaller


        return false;
    }

    private void generateConfigFile(HttpServletRequest request, Kernel kernel, PrintWriter out) throws ParserConfigurationException, NoSuchStoreException, TransformerException {
        ConfigurationManager mgr = ConfigurationUtil.getConfigurationManager(kernel);
        PluginInstaller installer = getInstaller(kernel);
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        factory.setNamespaceAware(true);
        DocumentBuilder builder = factory.newDocumentBuilder();
        Document doc = builder.newDocument();
        Element root = doc.createElementNS("http://geronimo.apache.org/xml/ns/plugins-1.1", "geronimo-plugin-list");
        doc.appendChild(root);
        List stores = mgr.listStores();
        for (int i = 0; i < stores.size(); i++) {
            AbstractName name = (AbstractName) stores.get(i);
            List configs = mgr.listConfigurations(name);
            for (int j = 0; j < configs.size(); j++) {
                ConfigurationInfo info = (ConfigurationInfo) configs.get(j);
                PluginMetadata data = installer.getPluginMetadata(info.getConfigID());
                Element config = doc.createElement("plugin");
                root.appendChild(config);
                createText(doc, config, "name", data.getName());
                createText(doc, config, "module-id", data.getModuleId().toString());
                createText(doc, config, "category", "Geronimo Deployments");
View Full Code Here


            }
            if(installList == null) {
                throw new PortletException("No configuration found for '"+configId+"'");
            }

            PluginInstaller configInstaller = PortletManager.getCurrentServer(request).getPluginInstaller();
            Object downloadKey = configInstaller.startInstall(installList, user, pass);
            ProgressInfo progressInfo = new ProgressInfo();
            request.getPortletSession(true).setAttribute(ProgressInfo.PROGRESS_INFO_KEY, progressInfo, PortletSession.APPLICATION_SCOPE);
            // Kick off the download monitoring
            new Thread(new Installer(configInstaller, downloadKey, progressInfo, request.getPortletSession(true))).start();
View Full Code Here

        dispatcher.forward(request, response);
    }

    private void doInstall(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        Kernel kernel = KernelRegistry.getSingleKernel();
        PluginInstaller installer = getPluginInstaller(kernel);
        String moduleIdName = getInitParameter("moduleId");
        moduleIdName = moduleIdName.replaceAll("SERVER", getServerType());
        URL repo = getFirstPluginRepository(kernel);
        PluginMetadata target = new PluginMetadata("Sample Application", null, "Samples", "A sample application",
                                                   null, null, null, false, true);
        target.setDependencies(new String[]{moduleIdName});
        DownloadResults results = installer.install(new PluginList(new URL[]{repo, new URL("http://www.ibiblio.org/maven2/")},
                                                    new PluginMetadata[]{target}), null, null);
        if(results.isFailed()) {
            throw new ServletException("Unable to install sample application", results.getFailure());
        }
        ConfigurationManager mgr = ConfigurationUtil.getConfigurationManager(kernel);
View Full Code Here

    public PluginList listPlugins(URL mavenRepository, String username, String password) throws FailedLoginException, IOException {
        Set set = kernel.listGBeans(new AbstractNameQuery(PluginInstaller.class.getName()));
        for (Iterator it = set.iterator(); it.hasNext();) {
            AbstractName name = (AbstractName) it.next();
            PluginInstaller installer = (PluginInstaller) kernel.getProxyManager().createProxy(name, PluginInstaller.class);
            PluginList results = installer.listPlugins(mavenRepository, username, password);
            kernel.getProxyManager().destroyProxy(installer);
            return results;
        }
        return null;
    }
View Full Code Here

    public DownloadResults install(PluginList installList, String username, String password) {
        Set set = kernel.listGBeans(new AbstractNameQuery(PluginInstaller.class.getName()));
        for (Iterator it = set.iterator(); it.hasNext();) {
            AbstractName name = (AbstractName) it.next();
            PluginInstaller installer = (PluginInstaller) kernel.getProxyManager().createProxy(name, PluginInstaller.class);
            DownloadResults results = installer.install(installList, username, password);
            kernel.getProxyManager().destroyProxy(installer);
            return results;
        }
        return null;
    }
View Full Code Here

    public void install(PluginList configsToInstall, String username, String password, DownloadPoller poller) {
        Set set = kernel.listGBeans(new AbstractNameQuery(PluginInstaller.class.getName()));
        for (Iterator it = set.iterator(); it.hasNext();) {
            AbstractName name = (AbstractName) it.next();
            PluginInstaller installer = (PluginInstaller) kernel.getProxyManager().createProxy(name, PluginInstaller.class);
            installer.install(configsToInstall, username, password, poller);
            kernel.getProxyManager().destroyProxy(installer);
            return;
        }
    }
View Full Code Here

    public Object startInstall(PluginList configsToInstall, String username, String password) {
        Set set = kernel.listGBeans(new AbstractNameQuery(PluginInstaller.class.getName()));
        for (Iterator it = set.iterator(); it.hasNext();) {
            AbstractName name = (AbstractName) it.next();
            PluginInstaller installer = (PluginInstaller) kernel.getProxyManager().createProxy(name, PluginInstaller.class);
            Object result = installer.startInstall(configsToInstall, username, password);
            kernel.getProxyManager().destroyProxy(installer);
            return result;
        }
        return null;
    }
View Full Code Here

            RemoteDeployUtil.uploadFilesToServer(args, progress);
        }
        Set set = kernel.listGBeans(new AbstractNameQuery(PluginInstaller.class.getName()));
        for (Iterator it = set.iterator(); it.hasNext();) {
            AbstractName name = (AbstractName) it.next();
            PluginInstaller installer = (PluginInstaller) kernel.getProxyManager().createProxy(name, PluginInstaller.class);
            Object result = installer.startInstall(carFile, username, password);
            kernel.getProxyManager().destroyProxy(installer);
            return result;
        }
        return null;
    }
View Full Code Here

    public DownloadResults checkOnInstall(Object key) {
        Set set = kernel.listGBeans(new AbstractNameQuery(PluginInstaller.class.getName()));
        for (Iterator it = set.iterator(); it.hasNext();) {
            AbstractName name = (AbstractName) it.next();
            PluginInstaller installer = (PluginInstaller) kernel.getProxyManager().createProxy(name, PluginInstaller.class);
            DownloadResults result = installer.checkOnInstall(key);
            kernel.getProxyManager().destroyProxy(installer);
            return result;
        }
        return null;
    }
View Full Code Here

    public Map getInstalledPlugins() {
        Set set = kernel.listGBeans(new AbstractNameQuery(PluginInstaller.class.getName()));
        for (Iterator it = set.iterator(); it.hasNext();) {
            AbstractName name = (AbstractName) it.next();
            PluginInstaller installer = (PluginInstaller) kernel.getProxyManager().createProxy(name, PluginInstaller.class);
            Map result = installer.getInstalledPlugins();
            kernel.getProxyManager().destroyProxy(installer);
            return result;
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.system.plugin.PluginInstaller

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.