FileDocCategorySizeDatePackage
ListenerTest.javaAPI DocGlassfish v2 API3636Fri May 04 22:23:54 BST 2007com.sun.enterprise.management.base

ListenerTest

public final class ListenerTest extends com.sun.enterprise.management.AMXTestBase

Fields Summary
Constructors Summary
public ListenerTest()

    
Methods Summary
public voidtestAddRemoveNotificationListener()

	    final long  start   = now();
	    final Set<AMX>  all = getAllAMX();
	    
	    final NotificationListener  listener1    = new DummyListener();
	    final NotificationListener  listener2    = new DummyListener();
	    
	    final NotificationFilter    filter  = new NotificationFilterSupport();
	    final Object    handback    = "handback";
	    
	    for( final AMX amx : all )
	    {
	        amx.getNotificationInfo();
	        amx.addNotificationListener( listener1, null, null );
	        amx.addNotificationListener( listener2, filter, handback );
	    }
	    
	    for( final AMX amx : all )
	    {
	        amx.removeNotificationListener( listener1 );
	        amx.removeNotificationListener( listener2, filter, handback );
	    }
	    
	    printElapsed( "Added/removed NotificationListener", all.size(), start );