1 23 package com.sun.appserv.management.util.jmx.stringifier; 24 25 import javax.management.AttributeChangeNotification ; 26 27 import com.sun.appserv.management.util.stringifier.Stringifier; 28 import com.sun.appserv.management.util.stringifier.SmartStringifier; 29 30 31 public class AttributeChangeNotificationStringifier 32 extends NotificationStringifier implements Stringifier 33 { 34 public static final AttributeChangeNotificationStringifier DEFAULT = 35 new AttributeChangeNotificationStringifier(); 36 37 public 38 AttributeChangeNotificationStringifier( ) 39 { 40 super(); 41 } 42 43 public 44 AttributeChangeNotificationStringifier( Options options ) 45 { 46 super( options ); 47 } 48 49 public String 50 stringify( Object o ) 51 { 52 final AttributeChangeNotification notif = (AttributeChangeNotification )o; 53 54 final StringBuffer b = super._stringify( notif ); 55 append( b, "" ); 56 57 final String attrName = notif.getAttributeName(); 58 final String oldValue = SmartStringifier.toString( notif.getOldValue() ); 59 final String newValue = SmartStringifier.toString( notif.getNewValue() ); 60 61 final String msg = attrName + ": " + oldValue + " => " + newValue; 62 b.append( msg ); 63 64 return( b.toString() ); 65 } 66 } 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | Popular Tags |