FileDocCategorySizeDatePackage
ExternalStimulusHandler.javaAPI DocAzureus 3.0.3.42426Wed May 09 15:34:54 BST 2007com.aelitis.azureus.util

ExternalStimulusHandler

public class ExternalStimulusHandler extends Object

Fields Summary
private static com.aelitis.azureus.plugins.magnet.MagnetPlugin
magnet_plugin
Constructors Summary
Methods Summary
public static voidaddListener(ExternalStimulusListener listener)

		
		if ( magnet_plugin != null ){
			
			magnet_plugin.addListener(
				new MagnetPluginListener()
				{
					public boolean
					set(
						String		name,
						Map		values )
					{
						return( listener.receive( name, values ));
					}
				});
		}
	
protected static voidinitialise(com.aelitis.azureus.core.AzureusCore core)

		PluginInterface pi = core.getPluginManager().getPluginInterfaceByClass( MagnetPlugin.class );
		
		if ( pi != null ){
		
			magnet_plugin = (MagnetPlugin)pi.getPlugin();
			
		}else{
						
			Debug.out( "Failed to resolve magnet plugin" );
		}	
		
		Debug.outNoStack( "ExternalStimulus debug" );
		
		addListener( 
				new ExternalStimulusListener()
				{
					public boolean 
					receive(
						String name, Map values ) 
					{
						System.out.println( "ExternalStimulus: " + name );
						System.out.println("  " + (values == null ? -1 : values.size())
						+ " Values: " + values);
						
						return( name.equals("ExternalStimulus.test"));
					}
				});