FileDocCategorySizeDatePackage
CLISupportSimpleTestee.javaAPI DocGlassfish v2 API6699Fri May 04 22:24:52 BST 2007com.sun.cli.jmx.test

CLISupportSimpleTestee

public class CLISupportSimpleTestee extends NotificationBroadcasterSupport implements CLISupportSimpleTesteeMBean

Fields Summary
volatile long
mNotifMillis
volatile long
mNumNotifsEmitted
EmitterThread
mEmitterThread
Constructors Summary
public CLISupportSimpleTestee()

    
		
	
	
	
Methods Summary
booleanemitNotif(com.sun.cli.jmx.test.EmitterThread thread)

    	if ( mEmitterThread == null )
    	{
    		return( false );
    	}
    		
		final AttributeChangeNotification	notif	= new AttributeChangeNotification( this,
			mNumNotifsEmitted,	// use this as sequence number
			System.currentTimeMillis(),
			"did it again",
			"NotifsEmitted",
			"java.lang.long",
			Long.valueOf(mNumNotifsEmitted),
			Long.valueOf(mNumNotifsEmitted + 1));
		
		++mNumNotifsEmitted;
		
		sendNotification( notif );
		
		System.out.println( "emitted another one" );
		return( true );
    
public longgetNotifMillis()

        return mNotifMillis;
    
public longgetNotifsEmitted()

    	return( mNumNotifsEmitted );
    
public java.lang.ObjectgetUnknownType()

    	return( new AintGonnaHaveIt() );
    
public voidresetNotifsEmitted()

    	mNumNotifsEmitted	= 0;
    
public voidsetNotifMillis(long millis)

       	mNotifMillis	= millis;
       	
       	if ( mEmitterThread != null )
       	{
       		// restart with new interval
       		stopNotif();
       		startNotif();
       	}
    
public synchronized voidstartNotif()

    	stopNotif();
    	
    	System.out.println( "emitting notifications once per this many ms: " + mNotifMillis );
		mEmitterThread	= new EmitterThread( this, mNotifMillis);
		mEmitterThread.start();
    
public voidstopNotif()

    	if ( mEmitterThread != null )
    	{
    		EmitterThread thread	= mEmitterThread;
    	
    		mEmitterThread	= null;
    		try
    		{
    			thread.join( );
    		}
    		catch( InterruptedException e )
    		{
    		}
		}
    
public voidtest11MixedArgs(java.lang.String a1, boolean a2, char a3, byte a4, short a5, int a6, long a7, float a8, double a9, java.math.BigInteger a10, java.math.BigDecimal a11)

    	// no need to do anything
    
public voidtest11ObjectArgs(java.lang.String a1, java.lang.Boolean a2, java.lang.Character a3, java.lang.Byte a4, java.lang.Short a5, java.lang.Integer a6, java.lang.Long a7, java.lang.Float a8, java.lang.Double a9, java.math.BigInteger a10, java.math.BigDecimal a11)

    	// no need to do anything
    
public java.lang.StringtestCASESENSITIVITY1()

   		return( "testCASESENSITIVITY1" );
   	
public java.lang.StringtestCaseSensitivity1()

   		return( "testCaseSensitivity1" );
   	
public java.lang.StringtestCaseSensitivity2()

   		return( "testCaseSensitivity2" );
   	
public java.lang.IntegertestInteger(java.lang.Integer i)

		return( i );
	
public java.lang.ObjecttestObject(java.lang.Object obj)

    	return( obj );
    
public java.lang.Object[]testObjectArray(java.lang.Object[] objects)

		return( objects );
	
public java.lang.StringtestString(java.lang.String s)

   		return( s );
   	
public java.net.URItestURI(java.net.URI u)

    	return( u );
    
public java.net.URLtestURL(java.net.URL u)

    	return( u );
    
public java.lang.ObjecttestUnknownType()

    	return( new AintGonnaHaveIt() );
    
public inttest_int(int i)

    	return( i );
    
public java.lang.Stringtestcasesensitivity1()

   		return( "testcasesensitivity1" );