Package org.gudy.azureus2.plugins.update

Examples of org.gudy.azureus2.plugins.update.UpdateManager


  private void allDownloadsComplete() {
    boolean bRequiresRestart = false;
    boolean bHadMandatoryUpdates = false;
   
    for (int i = 0; i < updates.length; i++) {
      Update update = updates[i];
        // updates with no downloaders exist for admin purposes only
      if ( update.getDownloaders().length > 0){
        if (update.getRestartRequired() != Update.RESTART_REQUIRED_NO) {
          bRequiresRestart = true;
        }
        if ( update.isMandatory()){
          bHadMandatoryUpdates = true;
        }
      }
    }
View Full Code Here


          handleEvent(Event event)
          {
            try{
              PluginInterface pi = AzureusCoreFactory.getSingleton().getPluginManager().getDefaultPluginInterface();
             
              UpdateInstaller installer = pi.getUpdateManager().createInstaller();
           
              installer.addMoveAction(
                "C:\\temp\\file1", "C:\\temp\\file2" );
           
              installer.installNow(
                new UpdateInstallerListener()
                {
                  public void
                  reportProgress(
                    String    str )
View Full Code Here

           
              installer.addMoveAction(
                "C:\\temp\\file1", "C:\\temp\\file2" );
           
              installer.installNow(
                new UpdateInstallerListener()
                {
                  public void
                  reportProgress(
                    String    str )
                  {
View Full Code Here

 
              // discard any pending updates as we need to shutdown immediately (this
              // is called from installer to close running instance)
           
            try{
              UpdateManager um = core.getPluginManager().getDefaultPluginInterface().getUpdateManager();
             
              UpdateInstaller[] installers = um.getInstallers();
             
              for ( UpdateInstaller installer: installers ){
               
                installer.destroy();
              }
View Full Code Here

    if ( pi != null ){
     
      pi.getPluginState().setDisabled( true );
    }
   
    UpdateManager update_manager = azureus_core.getPluginManager().getDefaultPluginInterface().getUpdateManager();
   
    UpdateCheckInstance  checker = update_manager.createUpdateCheckInstance();
   
    checker.addListener(
      new UpdateCheckInstanceListener()
      {
        public void
View Full Code Here

      // we don't want our update to interfere with the normal update process so
      // hang around until it completes
   
    PluginInterface pi = azureus_core.getPluginManager().getDefaultPluginInterface();
   
    UpdateManager update_manager = pi.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( null );
      }
     
      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( null );
    }
   
    UpdateInstaller installer = pi.getUpdateManager().createInstaller();
View Full Code Here

      public void
      runSupport()
      { 
        try{
 
          UpdateManager  update_man = manager.getDefaultPluginInterface().getUpdateManager();
         
          UpdateInstaller installer = update_man.createInstaller();
         
          File  from_file   = new File( "C:\\temp\\update_from" );
          File  to_file    = new File( "C:\\temp\\update_to" );
         
          PrintWriter pw = new PrintWriter( new FileWriter( from_file ));
         
          pw.println( "hello mum");
         
          pw.close();
         
          to_file.delete();
         
          installer.addMoveAction( from_file.toString(), to_file.toString());
         
          update_man.applyUpdates( false );
         
        }catch( Throwable e ){
         
          e.printStackTrace();
        }
View Full Code Here

        {
           
         
          try
          {
              UpdateManager um = pluginInterface.getUpdateManager();
              UpdateInstaller updateInstaller = um.createInstaller();   
              int i = 0;
              while (!complete_file_from.isEmpty()){
                 
                  File from = new File (complete_file_from.pop());
                  if(!from.isFile())
                  {
                      StatusBoxUtils.mainStatusAdd(" Could not update because " + from.getName() " is not a real file",2);
                  }
                  //System.out.println("From: " + from.getPath() + " To: " + complete_file_to.peek());
                  //System.out.println("addResource: azcvsupdater_" + i);
                  updateInstaller.addResource("azcvsupdater_" + i , new FileInputStream (from));
                  if(!complete_file_to.isEmpty())
                  {
                      updateInstaller.addMoveAction("azcvsupdater_" + i , complete_file_to.pop());
                  }

                    i++;
              }
              //System.out.println("AZCVSUpdater:  Sleeping for 5 seconds to ensure all has completed");
                Thread.sleep(5000);
                um.applyUpdates(restart);
                     
         
          }
          catch (Exception e)
          {
View Full Code Here

        {
           
         
          try
          {
              UpdateManager um = pluginInterface.getUpdateManager();
              UpdateInstaller updateInstaller = um.createInstaller();   
              int i = 0;
              while (!complete_file_from.isEmpty()){
                 
                   
                  File from = new File (complete_file_from.pop());
View Full Code Here

                {
                   
           
            try
            {
                UpdateManager um = pluginInterface.getUpdateManager();
                UpdateInstaller updateInstaller = um.createInstaller();   
                int i = 0;
                while (!complete_file_from.isEmpty()){
                   
                   
                    //System.out.println("From: " + complete_file_from.peek() + " To: " + complete_file_to.peek());
                    if(!complete_file_to.isEmpty())
                    {
                       updateInstaller.addMoveAction(complete_file_from.pop(),complete_file_to.pop());
                    }

                    i++;
                }
                //System.out.println("AZCVSUpdater:  Sleeping for 5 seconds to ensure all has completed");
                Thread.sleep(5000);
                um.applyUpdates(restart);
                       
           
            }
            catch (Exception e)
            {
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.plugins.update.UpdateManager

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.