FileDocCategorySizeDatePackage
ProtocolDecoder.javaAPI DocAzureus 3.0.3.43020Tue Nov 21 16:13:12 GMT 2006com.aelitis.azureus.core.networkmanager.impl

ProtocolDecoder

public abstract class ProtocolDecoder extends Object

Fields Summary
private static final LogIDs
LOGID
private static final int
TIMEOUT_CHECK
private static final int
LOG_TICKS
private static List
decoders
private static AEMonitor
class_mon
private static int
loop
Constructors Summary
protected ProtocolDecoder(boolean run_timer)

	
	
	
		
		SimpleTimer.addPeriodicEvent(
		"ProtocolDecoder:timeouts",
        5000,
        new TimerEventPerformer() {
          public void perform( TimerEvent ev ) {
       
          	loop++;
  					
  					long	now = SystemTime.getCurrentTime();
  					
  					try{
  						class_mon.enter();
  					
  						if ( loop % LOG_TICKS == 0 ){
  							
  					     	if (Logger.isEnabled()){
  					     		
  					     		if ( decoders.size() > 0 ){
  					     			
  					     			Logger.log(	new LogEvent(LOGID, "Active protocol decoders = " + decoders.size()));
  					     		}
  					     	}
  						}
  						
  						Iterator	it = decoders.iterator();
  						
  						while( it.hasNext()){
  							
  							ProtocolDecoder	decoder = (ProtocolDecoder)it.next();
  							
  							if ( decoder.isComplete( now )){
  								
  								it.remove();
  							}
  						}
  						
  					}finally{
  						
  						class_mon.exit();
  					}
          }
        }
     );
		
		
	
		if ( run_timer ){
			
			try{
				class_mon.enter();
				
				decoders.add( this );
				
			}finally{
				
				class_mon.exit();
			}
		}
	
Methods Summary
public static voidaddSecrets(byte[][] secrets)

		ProtocolDecoderPHE.addSecretsSupport( secrets );
	
public abstract TransportHelperFiltergetFilter()

public abstract booleanisComplete(long now)

public static voidremoveSecrets(byte[][] secrets)

		ProtocolDecoderPHE.removeSecretsSupport( secrets );