Package org.gudy.azureus2.plugins

Examples of org.gudy.azureus2.plugins.PluginInterface


            listener.failed( new Exception( "NAT traversal failed, initialisation not complete" ));
           
            return;
          }

          PluginInterface dht_pi =
            core.getPluginManager().getPluginInterfaceByClass( DHTPlugin.class );
         
          if ( dht_pi != null ){
           
            DHTPlugin dht_plugin = (DHTPlugin)dht_pi.getPlugin();
           
            if ( dht_plugin.isEnabled()){
             
              DHT dht = dht_plugin.getDHT( DHT.NW_MAIN );
             
View Full Code Here


              //installed plugin IDs
              PluginInterface[] plugins = AzureusCoreFactory.getSingleton().getPluginManager().getPluginInterfaces();

              for (int i=0;i<plugins.length;i++){

                PluginInterface    plugin = plugins[i];

                Map  data = plugin.getPluginconfig().getPluginMapParameter( "plugin.versionserver.data", null );

                if ( data != null ){

                  plugin.getPluginconfig().setPluginMapParameter( "plugin.versionserver.data", new HashMap());
                }
              }
            }
          }catch( Throwable e ){
          }
View Full Code Here

          List vs_data = new ArrayList();

          for (int i=0;i<plugins.length;i++){

            PluginInterface    plugin = plugins[i];

            String  pid = plugin.getPluginID();

            String  info = plugin.getPluginconfig().getPluginStringParameter( "plugin.info" );

            // filter out built-in and core ones
            if (   ( info != null && info.length() > 0 ) ||
                !pid.startsWith( "<" ) &&
                    !pid.startsWith( "azbp" ) &&
                    !pid.startsWith( "azupdater" ) &&
                    !pid.startsWith( "azplatform" ) &&
                    !pids.contains( pid ))){

              if ( info != null && info.length() > 0 ){

                if( info.length() < 256 ){

                  pid += ":" + info;

                }else{

                  Debug.out( "Plugin '" + pid + "' reported excessive info string '" + info + "'" );
                }
              }

              pids.add( pid );
            }

            Map  data = plugin.getPluginconfig().getPluginMapParameter( "plugin.versionserver.data", null );

            if ( data != null ){

              Map payload = new HashMap();

              byte[]  data_bytes = BEncoder.encode( data );

              if ( data_bytes.length > 16*1024 ){

                Debug.out( "Plugin '" + pid + "' reported excessive version server data (length=" + data_bytes.length + ")" );

                payload.put( "error", "data too long: " + data_bytes.length );

              }else{

                payload.put( "data", data_bytes );
              }

              payload.put( "id", pid);
              payload.put( "version", plugin.getPluginVersion());

              vs_data.add( payload );
            }
          }
          message.put( "plugins", pids );
View Full Code Here

  private List<SMDImpl>    streamers = new ArrayList<SMDImpl>();
 
  private
  StreamManager()
  {
    PluginInterface default_pi = PluginInitializer.getDefaultInterface();

    mi_ta = default_pi.getTorrentManager().getPluginAttribute( "sm_metainfo" );
   
    default_pi.addListener(
      new PluginListener()
      {
        public void
        initializationComplete()
        {
View Full Code Here

    }
   
    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
       
        return( true );
      }
     
      if ( !emp_pi.getPluginState().isOperational()){
       
          // can't use if emp borked
       
        return( false );
      }
     
        // emp installed but need version with prepareWindow, wait for update
     
      Class<?> epwClass = emp_pi.getPlugin().getClass().getClassLoader().loadClass( "com.azureus.plugins.azemp.ui.swt.emp.EmbeddedPlayerWindowSWT" );
     
      Method method = epwClass.getMethod( "prepareWindow", new Class[] { String.class });
     
      return( method != null );
     
View Full Code Here

       
        final Download download = PluginCoreUtils.wrap( dm );
       
        final DiskManagerFileInfo file = download.getDiskManagerFileInfo( file_index );
               
        PluginInterface emp_pi = checkPlugin( "azemp", "media player" );

        checkPlugin( "vuzexcode", "media analyser" );

        Class<?> epwClass = emp_pi.getPlugin().getClass().getClassLoader().loadClass( "com.azureus.plugins.azemp.ui.swt.emp.EmbeddedPlayerWindowSWT" );
       
        Method method = epwClass.getMethod( "prepareWindow", new Class[] { String.class });
       
        final Object player = method.invoke(null, new Object[] { file.getFile( true ).getName() });
     
View Full Code Here

   
      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 );
          }
         
          Thread.sleep(250);
        }
      }else if ( !pi.getPluginState().isOperational()){
       
        throw( new Exception( name + " not operational" ));
       
      }else{
       
View Full Code Here

  
    protected static void
    startUp()
    {
      PluginInterface plugin = PluginInitializer.getDefaultInterface();

      speedTestAttrib = plugin.getTorrentManager().getPluginAttribute(NetworkAdminSpeedTesterBTImpl.class.getName()+".test.attrib");
 
      org.gudy.azureus2.plugins.download.DownloadManager dm = plugin.getDownloadManager();
      Download[] downloads = dm.getDownloads();

      if(downloads!=null){
        int num = downloads.length;
        for(int i=0; i<num; i++){
View Full Code Here

      UPnPMapping new_mapping = null;

      if ( upnp_map ){
       
        PluginInterface pi_upnp = core.getPluginManager().getPluginInterfaceByClass( UPnPPlugin.class );

        if( pi_upnp != null ) {

          UPnPPlugin upnp = (UPnPPlugin)pi_upnp.getPlugin();

          UPnPMapping mapping = upnp.getMapping( type != PT_UDP , port );

          if ( mapping == null ) {
View Full Code Here

    PRUDPPacketHandler  packet_handler = handler.getHandler();

    HashMap  data_to_send = new HashMap();

    PluginInterface pi_upnp = core.getPluginManager().getPluginInterfaceByClass( UPnPPlugin.class );

    String  upnp_str = null;

    if( pi_upnp != null ) {

      UPnPPlugin upnp = (UPnPPlugin)pi_upnp.getPlugin();

      /*
      UPnPMapping mapping = upnp.getMapping( true, port );

      if ( mapping == null ) {
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.plugins.PluginInterface

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.