Examples of PluginInstaller


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

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

            }
            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

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

        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

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

    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

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

    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

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

    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

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

    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

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

            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

Examples of org.graylog2.plugins.PluginInstaller

            System.exit(1);
        }

        if (commandLineArguments.isInstallPlugin()) {
            System.out.println("Plugin installation requested.");
            PluginInstaller installer = new PluginInstaller(
                    commandLineArguments.getPluginShortname(),
                    commandLineArguments.getPluginVersion(),
                    commandLineArguments.isForcePlugin()
            );
           
            installer.install();
            System.exit(0);
        }

        // Are we in debug mode?
        Level logLevel = Level.INFO;
View Full Code Here

Examples of org.gudy.azureus2.plugins.installer.PluginInstaller

              final String  config_key = "recommended.processed." + rp_id;
             
              if ( !plugin_config.getPluginBooleanParameter( config_key, false )){
               
                try{
                  final PluginInstaller installer = plugin_interface.getPluginManager().getPluginInstaller();
                 
                  StandardPlugin[]  sps = installer.getStandardPlugins();
                 
                  for (int j=0;j<sps.length;j++){
                   
                    final StandardPlugin  sp = sps[j];
                   
                    if ( sp.getId().equals( rp_id )){
                   
                      found_one = true;
                     
                      checker.getCheckInstance().addListener(
                        new UpdateCheckInstanceListener()
                        {
                          public void
                          cancelled(
                            UpdateCheckInstance    instance )
                          {                         
                          }
                         
                          public void
                          complete(
                            UpdateCheckInstance    instance )
                          {
                            if ( instance.getUpdates().length == 0 ){
                             
                              installRecommendedPlugin( installer, sp );
                             
                              plugin_config.setPluginParameter( config_key, true );
                            }
                          }
                        });
                     
                      break;
                    }
                  }
                 
                }catch( Throwable e ){
                 
                }
              }
             
              if ( found_one ){
               
                break;
              }
            }
           
            if ( !found_one ){
             
              Set<String>  auto_install = vc.getAutoInstallPluginIDs();
             
              final List<String>  to_do = new ArrayList<String>();
             
              for ( String pid: auto_install ){
               
                if ( plugin_manager.getPluginInterfaceByID( pid, false ) == null ){
                 
                  to_do.add( pid );
                }
              }
             
              if ( to_do.size() > 0 ){
               
                new AEThread2( "pup:autoinst" )
                {
                  public void
                  run()
                  {   
                    try{
                      Thread.sleep( 120*1000 );
                     
                    }catch( Throwable e ){
                     
                      Debug.out( e );
                     
                      return;
                    }
                   
                    UpdateManager update_manager = plugin_interface.getUpdateManager();
                   
                    final List<UpdateCheckInstance>  l_instances = new ArrayList<UpdateCheckInstance>();
                   
                    update_manager.addListener(
                      new UpdateManagerListener()
                      {
                        public void
                        checkInstanceCreated(
                          UpdateCheckInstance  instance )
                        {
                          synchronized( l_instances ){
                           
                            l_instances.add( instance );
                          }
                        }
                      });
                   
                    UpdateCheckInstance[] instances = update_manager.getCheckInstances();
                   
                    l_instances.addAll( Arrays.asList( instances ));
                   
                    long start = SystemTime.getMonotonousTime();
                   
                    while( true ){
                     
                      if ( SystemTime.getMonotonousTime() - start >= 5*60*1000 ){
                       
                        break;
                      }
                     
                      try{
                        Thread.sleep(5000);
                       
                      }catch( Throwable e ){
                       
                        Debug.out( e );
                       
                        return;
                      }
                     
                      if ( l_instances.size() > 0 ){
                     
                        boolean  all_done = true;
                       
                        for ( UpdateCheckInstance instance: l_instances ){
                         
                          if ( !instance.isCompleteOrCancelled()){
                           
                            all_done = false;
                           
                            break;
                          }
                        }
                       
                        if ( all_done ){
                         
                          break;
                        }
                      }
                    }
                   
                    if ( update_manager.getInstallers().length > 0 ){
                     
                      return;
                    }
                   
                    PluginInstaller installer = plugin_interface.getPluginManager().getPluginInstaller();
                   
                    List<InstallablePlugin>  sps = new ArrayList<InstallablePlugin>();
                   
                    for ( String pid: to_do ){
                     
                      try{
                        StandardPlugin sp = installer.getStandardPlugin( pid );
                       
                        if ( sp != null ){
                         
                          log.log( "Auto-installing " + pid );
                         
                          sps.add( sp );
                         
                        }else{
                         
                          log.log( "Standard plugin '" + pid + "' missing" );
                        }
                      }catch( Throwable e ){
                       
                        log.log( "Standard plugin '" + pid + "' missing", e );
                      }
                    } 
                    
                    if ( sps.size() > 0 ){
                     
                      Map<Integer, Object> properties = new HashMap<Integer, Object>();
                 
                      properties.put( UpdateCheckInstance.PT_UI_STYLE, UpdateCheckInstance.PT_UI_STYLE_NONE );
                       
                      properties.put(UpdateCheckInstance.PT_UI_DISABLE_ON_SUCCESS_SLIDEY, true);
 
                      try{
                        installer.install(
                          sps.toArray( new InstallablePlugin[ sps.size()]),
                          false,
                          properties,
                          new PluginInstallationListener() {
   
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.