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