Package org.gudy.azureus2.core3.util

Examples of org.gudy.azureus2.core3.util.AEThread2


    canvas.setLayoutData(data);
  }
 
  public void start() {
    running = true;
    runner = new AEThread2("image runner",true) {
      public void run() {
        while(running) {
          try {
            renderNextImage();
            Thread.sleep(SPEED);
View Full Code Here


                      adapter.log( e );
                    }
                  }
                });
           
            new AEThread2("MCGroup:MCListener", true )
              {
                public void
                run()
                {
                  handleSocket( network_interface, ni_address, mc_sock, true );
                }
              }.start();
           
          }catch( Throwable e ){
           
            adapter.log( e );
          }           
       
            // now do the incoming control listener
         
          try{
            final DatagramSocket control_socket = new DatagramSocket( null );
             
            control_socket.setReuseAddress( true );
             
            control_socket.bind( new InetSocketAddress(ni_address, control_port ));
   
            if ( control_port == 0 ){
             
              control_port  = control_socket.getLocalPort();
             
              // System.out.println( "local port = " + control_port );
            }
           
            new AEThread2( "MCGroup:CtrlListener", true )
              {
                public void
                run()
                {
                  handleSocket( network_interface, ni_address, control_socket, false );
View Full Code Here

            public void run() {
              StringWriter sw = new StringWriter();
             
              PrintWriter  pw = new PrintWriter( sw );
                 
              IndentWriter iw = new IndentWriter( pw );
             
              NetworkAdmin admin = NetworkAdmin.getSingleton();
             
              admin.generateDiagnostics( iw );
             
View Full Code Here

    Map         localizationPaths,
    Collection       resource_bundles,
    int          initCapacity
  {
    this.initCapacity = initCapacity;
    messages = new LightHashMap(initCapacity);

    locale = main.getLocale();

      // use a somewhat decent initial capacity, proper calculation would require java 1.6
   
    addResourceMessages( main );
   
    synchronized (localizationPaths)
    {
      for (Iterator iter = localizationPaths.keySet().iterator(); iter.hasNext();){
        String localizationPath = (String) iter.next();
        ClassLoader classLoader = (ClassLoader) localizationPaths.get(localizationPath);

        addPluginBundle(localizationPath, classLoader);
      }
    }

    if (resource_bundles != null) {
      synchronized (resource_bundles)
      {
        for (Iterator itr = resource_bundles.iterator(); itr.hasNext();) {
          addResourceMessages((ResourceBundle)itr.next());
        }
      }

    }
   
    used_messages = new LightHashMap( messages.size());
   
    synchronized( bundle_map ){
     
      bundle_map.put( this, NULL_OBJECT );
     
View Full Code Here

  }
 
  protected Iterator
  getKeysLight()
  {
    Map m = new LightHashMap(loadMessages());
   
    return( m.keySet().iterator());
  }
View Full Code Here

      }
    }
   
    if ( clean_count > 5 ){
   
      Map  compact_um = new LightHashMap( used_messages.size() + 16 );
     
      compact_um.putAll( used_messages );
     
      used_messages = compact_um;
     
      return( false );
     
View Full Code Here

     
      Map  result;
     
      if ( scratch_file_is == null ){
       
        result = new LightHashMap();
       
      }else{
     
          // System.out.println( "read cache file " + scratch_file_name + " for " + this );

       
        Properties p = new Properties();
       
        InputStream  fis = scratch_file_is;
       
        try{
                 
          p.load( fis );
         
          fis.close();
         
          scratch_file_is = new FileInputStream( scratch_file_name );
         
          messages = new LightHashMap();
         
          messages.putAll( p );
         
          result = messages;
         
        }catch( Throwable e ){
         
          if ( fis != null ){
           
            try{
              fis.close();
             
            }catch( Throwable f ){
            }
          }
         
          Debug.out( "Failed to load message bundle scratch file", e );
         
          scratch_file_name.delete();
         
          scratch_file_is = null;
         
          result = new LightHashMap();
        }
      }
     
      if ( added_strings != null ){
       
View Full Code Here

      null_values = null;
    }
  }
 
  public void clearUsedMessagesMap(int initialCapacity) {
    used_messages = new LightHashMap(initialCapacity);
    if (null_values != null) {
      null_values = new ArrayList(0);
    }
  }
View Full Code Here

      if ( compact_timer == null && System.getProperty("transitory.startup", "0").equals("0")){
               
        compact_timer = SimpleTimer.addPeriodicEvent(
          "IRB:compactor",
          60*1000,
          new TimerEventPerformer()
          {
            public void
            perform(
              TimerEvent event )
            { 
View Full Code Here

          }
         
          System.setProperty( "java.protocol.handler.pkgs", handlers );
          */
       
        URL.setURLStreamHandlerFactory(new AzURLStreamHandlerFactory());
            
            // DNS cache timeouts
         
          System.setProperty("sun.net.inetaddr.ttl", "60");
          System.setProperty("networkaddress.cache.ttl", "60");
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.core3.util.AEThread2

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.