Examples of PluginManager


Examples of org.gudy.azureus2.plugins.PluginManager

      return;
    }
   
      // we've got to disable the auto-update components as we're not using them (yet...)
   
    PluginManager  pm = azureus_core.getPluginManager();
   
    pm.getPluginInstaller().addListener(
      new PluginInstallerListener()
      {
        public boolean
        installRequest(
          String        reason,
          InstallablePlugin  plugin )
       
          throws PluginException
          {
            out.println( "Plugin installation request for '" + plugin.getName() + "' - " + reason );
             
            String  desc = plugin.getDescription();
           
            String[]  bits = desc.split( "\n" );
           
            for (int i=0;i<bits.length;i++){
             
              out.println( "\t" + bits[i]);
            }
           
            return( true );
          }
      });
   
    PluginInterface  pi = pm.getPluginInterfaceByClass( CorePatchChecker.class );
   
    if ( pi != null ){
     
      pi.getPluginState().setDisabled( true );
    }
   
    pi = pm.getPluginInterfaceByClass( UpdaterUpdateChecker.class );
   
    if ( pi != null ){
     
      pi.getPluginState().setDisabled( true );
    }
View Full Code Here

Examples of org.gudy.azureus2.plugins.PluginManager

     
      return( false );
    }
   
    try{
      PluginManager plug_man = AzureusCoreFactory.getSingleton().getPluginManager();
     
      PluginInterface xcode_pi = plug_man.getPluginInterfaceByID( "vuzexcode", false );
 
      if ( xcode_pi != null && !xcode_pi.getPluginState().isOperational()){
       
          // can't use if xcode borked
       
        return( false );
      }
     
        // otherwise xcode will be installed on demand
     
      PluginInterface emp_pi = plug_man.getPluginInterfaceByID( "azemp", false );
 
      if ( emp_pi == null ){
       
          // will be installed on demand
       
View Full Code Here

Examples of org.gudy.azureus2.plugins.PluginManager

      String    id,
      String    name )
   
      throws Throwable
    {
      PluginManager plug_man = AzureusCoreFactory.getSingleton().getPluginManager();
     
      PluginInterface pi = plug_man.getPluginInterfaceByID( id, false );
     
      if ( pi == null ){
       
        listener.updateActivity( "Installing " + name );
       
        final AESemaphore sem = new AESemaphore( "analyserWait" );

        synchronized( StreamManager.this ){
         
          if ( cancelled ){
           
            throw( new Exception( "Cancelled" ));
          }
         
          active_sem  = sem;
        }
       
        final Throwable[] error = { null };
       
        new SimplePluginInstaller(
            id,
              "dlg.install." + id,
              new UIFunctions.actionListener()
            {
              public void
              actionComplete(
                Object    result )
              {
                try{
                  if ( result instanceof Boolean ){
                   
                  }else{
                   
                    error[0] = (Throwable)result;
                  }
                }finally{
                 
                  sem.release();
                }
              }
            });
       
        sem.reserve();
       
        synchronized( StreamManager.this ){
         
          if ( cancelled ){
             
            throw( new Exception( "Cancelled" ));
          }
         
          active_sem  = null;
        }

        if( error[0] != null ){
         
          throw( error[0] );
        }
       
        long start = SystemTime.getMonotonousTime();
       
        listener.updateActivity( "Waiting for plugin initialisation" );
       
        while( true ){
         
          if ( cancelled ){
           
            throw( new Exception( "Cancelled" ));
          }
         
          if ( SystemTime.getMonotonousTime() - start >= 30*1000 ){
           
            throw( new Exception( "Timeout waiting for " + name + " to initialise" ));
          }
         
          pi = plug_man.getPluginInterfaceByID( id, false );

          if ( pi != null && pi.getPluginState().isOperational()){
           
            return( pi );
          }
View Full Code Here

Examples of org.gudy.azureus2.plugins.PluginManager

 
  private void init(
      AzureusCore azureus_core )
  {
   
    final PluginManager pm = azureus_core.getPluginManager();
   
    final PluginInterface default_pi = pm.getDefaultPluginInterface();
   
    default_pi.addListener(
      new PluginListener()
      {
        public void
        initializationComplete()
        {
          default_pi.addEventListener(
            new PluginEventListener()
            {
              public void
              handleEvent(
                PluginEvent ev )
              {
                int  type = ev.getType();
               
                if ( type == PluginEvent.PEV_PLUGIN_OPERATIONAL ){
                 
                  pluginAdded((PluginInterface)ev.getValue());
                }
                if ( type == PluginEvent.PEV_PLUGIN_NOT_OPERATIONAL ){
                 
                  pluginRemoved((PluginInterface)ev.getValue());
                }
              }
            });
         
          PluginInterface[] plugins = pm.getPlugins();
         
          for ( PluginInterface pi: plugins ){
           
            if ( pi.getPluginState().isOperational()){
           
View Full Code Here

Examples of org.gudy.azureus2.plugins.PluginManager

    PlatformMessenger.queueMessage(message, null);
  }

  private static void addPluginVersionsToMap(Map map) {
    if (AzureusCoreFactory.isCoreRunning()) {
      PluginManager pm = AzureusCoreFactory.getSingleton().getPluginManager();
      PluginInterface pi;
      pi = pm.getPluginInterfaceByID("vuzexcode");
      if (pi != null) {
        map.put("xcode-plugin-version", pi.getPluginVersion());
      }
      pi = pm.getPluginInterfaceByID("azitunes");
      if (pi != null) {
        map.put("itunes-plugin-version", pi.getPluginVersion());
      }
    }
    map.put("os-name", Constants.OSName);
View Full Code Here

Examples of org.gudy.azureus2.plugins.PluginManager

   */
  public static String getMediaServerContentURL(Download dl) {
 
    //TorrentListViewsUtils.debugDCAD("enter - getMediaServerContentURL");
 
    PluginManager pm = AzureusCoreFactory.getSingleton().getPluginManager();
    PluginInterface pi = pm.getPluginInterfaceByID("azupnpav", false);
 
    if (pi == null) {
      Logger.log(new LogEvent(LogIDs.UI3, "Media server plugin not found"));
      return null;
    }
View Full Code Here

Examples of org.gudy.azureus2.plugins.PluginManager

 
  public static URL getMediaServerContentURL(DiskManagerFileInfo file) {
   
    //TorrentListViewsUtils.debugDCAD("enter - getMediaServerContentURL");
 
    PluginManager pm = AzureusCoreFactory.getSingleton().getPluginManager();
    PluginInterface pi = pm.getPluginInterfaceByID("azupnpav", false);
 
    if (pi == null) {
      Logger.log(new LogEvent(LogIDs.UI3, "Media server plugin not found"));
      return null;
    }
View Full Code Here

Examples of org.gudy.azureus2.plugins.PluginManager

  }

  private void openIrc(final String server, final String channel,
      final String alias) {
    try {
      PluginManager pluginManager = PluginInitializer.getDefaultInterface().getPluginManager();
      PluginInterface piChat = pluginManager.getPluginInterfaceByID("azplugins");
      UIManager manager = piChat.getUIManager();
      manager.addUIListener(new UIManagerListener() {
        public void UIDetached(UIInstance instance) {
        }
View Full Code Here

Examples of org.gudy.azureus2.plugins.PluginManager

      public void deviceManagerLoaded() {
        device_manager.removeListener(this);
        if (entryHeader == null || entryHeader.isDisposed()) {
          return;
        }
        PluginManager pm = AzureusCoreFactory.getSingleton().getPluginManager();
        PluginInterface pi;
        pi = pm.getPluginInterfaceByID("vuzexcode");
        if (device_manager.getTranscodeManager().getProviders().length == 0 || pi == null) {
          // provider plugin not installed yet

          final MdiEntryVitalityImage turnon = entryHeader.addVitalityImage("image.sidebar.turnon");
          if (turnon != null) {
View Full Code Here

Examples of org.hotswap.agent.config.PluginManager

    AnnotationProcessor annotationProcessor = context.mock(AnnotationProcessor.class);
    Instrumentation instrumentation = context.mock(Instrumentation.class);

    @Test
    public void testInit() throws Exception {
        PluginManager pluginManager = PluginManager.getInstance();

        context.checking(new Expectations() {{
            allowing(instrumentation).addTransformer(with(any(ClassFileTransformer.class)));
            allowing(annotationScanner).scanPlugins(with(any(ClassLoader.class)), with(any(String.class)));
            will(returnValue(Collections.singletonList(SimplePlugin.class.getName())));
            allowing(annotationProcessor).processAnnotations(with(any(Class.class)), with(any(Class.class)));
            will(returnValue(true));
        }});

        PluginRegistry pluginRegistry = pluginManager.getPluginRegistry();
        pluginRegistry.setAnnotationScanner(annotationScanner);
        pluginRegistry.setAnnotationProcessor(annotationProcessor);
        pluginManager.init(instrumentation);

        assertEquals("Plugin registered", pluginRegistry.getRegisteredPlugins().size(), 1);
        assertTrue("Plugin correct class", pluginRegistry.getRegisteredPlugins().keySet().iterator().next().equals(SimplePlugin.class));
    }
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.