1 package tests.jfun.yan.monitoring; 2 3 import java.beans.PropertyDescriptor ; 4 import java.lang.reflect.Constructor ; 5 import java.lang.reflect.Method ; 6 7 import jfun.yan.monitoring.ComponentMonitor; 8 9 public class BookmarkMonitor implements ComponentMonitor { 10 private boolean constructing = false; 11 private boolean constructed = false; 12 private boolean constructionFailed = false; 13 private boolean invoking = false; 14 private boolean invoked = false; 15 private boolean invocationFailed = false; 16 private boolean getting = false; 17 private boolean got = false; 18 private boolean setting = false; 19 private boolean set = false; 20 private boolean gettingFailed = false; 21 private boolean settingFailed = false; 22 public boolean isGettingFailed() { 23 return gettingFailed; 24 } 25 26 public boolean isSettingFailed() { 27 return settingFailed; 28 } 29 30 public boolean isConstructed() { 31 return constructed; 32 } 33 34 public boolean isConstructing() { 35 return constructing; 36 } 37 38 public boolean isConstructionFailed() { 39 return constructionFailed; 40 } 41 42 public boolean isGetting() { 43 return getting; 44 } 45 46 public boolean isGot() { 47 return got; 48 } 49 50 public boolean isInvocationFailed() { 51 return invocationFailed; 52 } 53 54 public boolean isInvoked() { 55 return invoked; 56 } 57 58 public boolean isInvoking() { 59 return invoking; 60 } 61 62 public boolean isSet() { 63 return set; 64 } 65 66 public boolean isSetting() { 67 return setting; 68 } 69 70 public void constructing(Constructor ctor, Object [] args) { 71 this.constructing = true; 72 73 } 74 75 public void constructed(Constructor ctor, Object [] args, Object instance, 76 long duration) { 77 this.constructed = true; 78 79 } 80 81 public void constructionFailed(Constructor ctor, Object [] args, Throwable e, 82 long duration) { 83 this.constructionFailed = true; 84 85 } 86 87 public void invoking(Object obj, Method mtd, Object [] args) { 88 this.invoking = true; 89 90 } 91 92 public void invoked(Object obj, Method mtd, Object [] args, Object result, 93 long duration) { 94 this.invoked = true; 95 96 } 97 98 public void invocationFailed(Object obj, Method mtd, Object [] args, 99 Throwable err, long duration) { 100 this.invocationFailed = true; 101 102 } 103 104 public void propertyGetting(Object obj, PropertyDescriptor desc) { 105 this.getting = true; 106 107 } 108 109 public void propertyGot(Object obj, PropertyDescriptor desc, Object result, 110 long duration) { 111 this.got = true; 112 113 } 114 115 public void propertyGetFailed(Object obj, PropertyDescriptor desc, 116 Throwable err, long duration) { 117 this.gettingFailed = true; 118 119 } 120 121 public void propertySetting(Object obj, PropertyDescriptor desc, Object val) { 122 this.setting = true; 123 124 } 125 126 public void propertySet(Object obj, PropertyDescriptor desc, Object val, 127 long duration) { 128 this.set = true; 129 130 } 131 132 public void propertySetFailed(Object obj, PropertyDescriptor desc, 133 Object val, Throwable err, long duration) { 134 this.settingFailed = true; 135 136 } 137 138 public void propertyGetting(Object obj, PropertyDescriptor desc, int ind) { 139 this.getting = true; 140 141 } 142 143 public void propertyGot(Object obj, PropertyDescriptor desc, int ind, 144 Object val, long duration) { 145 this.got = true; 146 147 } 148 149 public void propertyGetFailed(Object obj, PropertyDescriptor desc, int ind, 150 Throwable err, long duration) { 151 this.gettingFailed = true; 152 153 } 154 155 public void propertySetting(Object obj, PropertyDescriptor desc, int ind, 156 Object val) { 157 this.setting = true; 158 159 } 160 161 public void propertySet(Object obj, PropertyDescriptor desc, int ind, 162 Object val, long duration) { 163 this.set = true; 164 165 } 166 167 public void propertySetFailed(Object obj, PropertyDescriptor desc, int ind, 168 Object val, Throwable err, long duration) { 169 this.settingFailed = true; 170 171 } 172 173 } 174 | Popular Tags |