FileDocCategorySizeDatePackage
NotificationStringifier.javaAPI DocGlassfish v2 API4443Fri May 04 22:31:06 BST 2007com.sun.appserv.management.util.jmx.stringifier

NotificationStringifier

public class NotificationStringifier extends Object implements com.sun.appserv.management.util.stringifier.Stringifier

Fields Summary
public static final NotificationStringifier
DEFAULT
protected Options
mOptions
Constructors Summary
public NotificationStringifier()

		mOptions	= new Options();
	
public NotificationStringifier(Options options)

		mOptions	= options;
	
Methods Summary
protected java.lang.StringBuffer_stringify(javax.management.Notification notif)

		final StringBuffer	b	= new StringBuffer();
		
		if ( mOptions.mIncludeSequenceNumber )
		{
			append( b, "#" + notif.getSequenceNumber() );
		}

		if ( mOptions.mIncludeTimeStamp )
		{
			append( b, new Date( notif.getTimeStamp() ) );
		}

		if ( mOptions.mIncludeObjectName )
		{
			append( b, StringUtil.quote( notif.getSource() ) );
		}

		if ( mOptions.mIncludeType )
		{
			append( b, notif.getType() );
		}

		if ( mOptions.mIncludeUserData )
		{
			append( b, StringUtil.quote( notif.getUserData() ) );
		}
		
		if ( notif instanceof MBeanServerNotification )
		{
			// this should really be done in a MBeanServerNotificationStringifier!
			final MBeanServerNotification	n	= (MBeanServerNotification)notif;
			
			append( b, StringUtil.quote( n.getMBeanName() ) );
		}
		
		return( b );
	
protected voidappend(java.lang.StringBuffer b, java.lang.Object o)

		if ( b.length() != 0 )
		{
			b.append( mOptions.mDelim );
		}
		
		b.append( SmartStringifier.toString( o ) );
	
public java.lang.Stringstringify(java.lang.Object o)

		final Notification	notif	= (Notification)o;
		
		return( _stringify( notif ).toString() );
	
public static java.lang.StringtoString(java.lang.Object o)

		return( DEFAULT.stringify( o ) );