FileDocCategorySizeDatePackage
NetworkAdminSpeedTesterImpl.javaAPI DocAzureus 3.0.3.42834Tue May 08 13:38:26 BST 2007com.aelitis.azureus.core.networkmanager.admin.impl

NetworkAdminSpeedTesterImpl

public abstract class NetworkAdminSpeedTesterImpl extends Object implements com.aelitis.azureus.core.networkmanager.admin.NetworkAdminSpeedTester

Fields Summary
private com.aelitis.azureus.core.util.CopyOnWriteList
listeners
private boolean
result_reported
Constructors Summary
Methods Summary
protected abstract voidabort(java.lang.String reason)

protected abstract voidabort(java.lang.String reason, java.lang.Throwable cause)

public voidaddListener(com.aelitis.azureus.core.networkmanager.admin.NetworkAdminSpeedTesterListener listener)

    
      
    
    		 
    
      
    
    			
    	 	 

	    
		listeners.add( listener );
	
public voidremoveListener(com.aelitis.azureus.core.networkmanager.admin.NetworkAdminSpeedTesterListener listener)

		listeners.remove( listener );
	
protected voidsendResultToListeners(com.aelitis.azureus.core.networkmanager.admin.NetworkAdminSpeedTesterResult r)
Send a Result to all of the NetworkAdminSpeedTestListeners.

param
r - Result of the test.

			// just report the first result in case an implementation hits this more than once
		
		synchronized( this ){
			
			if ( result_reported ){
				
				return;
			}
			
			result_reported = true;
		}
		
		Iterator	it = listeners.iterator();

		while( it.hasNext()){

			try{
				((NetworkAdminSpeedTesterListener)it.next()).complete( this, r );

			}catch( Throwable e ){

				Debug.printStackTrace(e);
			}
		}
	
protected voidsendStageUpdateToListeners(java.lang.String status)


		Iterator	it = listeners.iterator();

		while( it.hasNext()){

			try{
				((NetworkAdminSpeedTesterListener)it.next()).stage( this, status );

			}catch( Throwable e ){

				Debug.printStackTrace(e);
			}
		}