1 8 9 package test.javax.management.support; 10 11 import javax.management.Attribute ; 12 import javax.management.AttributeList ; 13 import javax.management.AttributeNotFoundException ; 14 import javax.management.DynamicMBean ; 15 import javax.management.InvalidAttributeValueException ; 16 import javax.management.MBeanException ; 17 import javax.management.MBeanInfo ; 18 import javax.management.ReflectionException ; 19 20 23 public class ComplianceSupport 24 { 25 public static class NoManagement 27 { 28 } 29 30 31 public interface LexicalPatternNotRespectedMBean 33 { 34 public void fake(); 35 } 36 37 public static class DoesntRespectLexicalPattern implements LexicalPatternNotRespectedMBean 38 { 39 public void fake() 40 { 41 } 42 } 43 44 45 public interface OverloadedAttributeSetSetMBean 47 { 48 public void setAttribute(String s); 49 50 public void setAttribute(Integer i); 51 } 52 53 public static class OverloadedAttributeSetSet implements OverloadedAttributeSetSetMBean 54 { 55 public void setAttribute(String s) 56 { 57 } 58 59 public void setAttribute(Integer i) 60 { 61 } 62 } 63 64 public interface OverloadedAttributeGetSetMBean 65 { 66 public String getAttribute(); 67 68 public void setAttribute(Integer i); 69 } 70 71 public static class OverloadedAttributeGetSet implements OverloadedAttributeGetSetMBean 72 { 73 public String getAttribute() 74 { 75 return null; 76 } 77 78 public void setAttribute(Integer i) 79 { 80 } 81 } 82 83 public interface OverloadedAttributeIsGetMBean 84 { 85 public boolean isBoolean(); 86 87 public boolean getBoolean(); 88 } 89 90 public static class OverloadedAttributeIsGet implements OverloadedAttributeIsGetMBean 91 { 92 public boolean isBoolean() 93 { 94 return false; 95 } 96 97 public boolean getBoolean() 98 { 99 return false; 100 } 101 } 102 103 104 109 110 public static interface BasicStandardMBean 112 { 113 public void test(); 114 } 115 116 public static class BasicStandard implements BasicStandardMBean 117 { 118 private int m_count; 119 120 public void noManage() 122 { 123 } 124 125 public void test() 126 { 127 ++m_count; 128 } 129 } 130 131 132 public static class Derived extends BasicStandard 134 { 135 public void derivedNoManage() 136 { 137 } 138 } 139 140 141 public interface BaseMBean 143 { 144 public void base(); 145 } 146 147 public interface InheritedMBean extends BaseMBean 148 { 149 public void derived(); 150 151 public void test2(); 152 153 public void retest(); 154 } 155 156 public static class Inherited implements InheritedMBean 157 { 158 public void base() 159 { 160 } 161 162 public void derived() 163 { 164 } 165 166 public void test2() 167 { 168 } 169 170 public void retest() 171 { 172 } 173 } 174 175 176 public static class NotInherited extends BasicStandard implements InheritedMBean 178 { 179 public void base() 180 { 181 } 182 183 public void derived() 184 { 185 } 186 187 public void retest() 188 { 189 } 190 191 public void test2() 192 { 193 } 194 195 public void unManage() 196 { 197 } 198 } 199 200 201 public interface MultiMBean extends BasicStandardMBean, InheritedMBean 203 { 204 } 205 206 public static class Multi extends Inherited implements MultiMBean 207 { 208 public void test() 209 { 210 } 211 } 212 213 214 public interface PackagePrivateMBean 216 { 217 } 218 219 static class PackagePrivate implements PackagePrivateMBean 220 { 221 } 222 223 224 public interface StandardDynamicMBean 228 { 229 } 230 231 public static class StandardDynamic implements DynamicMBean , StandardDynamicMBean 232 { 233 public MBeanInfo getMBeanInfo() 234 { 235 return new MBeanInfo (getClass().getName(), null, null, null, null, null); 236 } 237 238 public Object getAttribute(String attribute) throws AttributeNotFoundException , MBeanException , ReflectionException 239 { 240 return null; 241 } 242 243 public void setAttribute(Attribute attribute) throws AttributeNotFoundException , InvalidAttributeValueException , MBeanException , ReflectionException 244 { 245 } 246 247 public AttributeList getAttributes(String [] attributes) 248 { 249 return new AttributeList (); 250 } 251 252 public AttributeList setAttributes(AttributeList attributes) 253 { 254 return new AttributeList (); 255 } 256 257 public Object invoke(String method, Object [] arguments, String [] params) throws MBeanException , ReflectionException 258 { 259 return null; 260 } 261 } 262 263 264 public interface StandardAndDynamicMBean extends DynamicMBean 267 { 268 public void mix(); 269 } 270 271 public static class StandardAndDynamic implements StandardAndDynamicMBean 272 { 273 public void mix() 274 { 275 } 276 277 public MBeanInfo getMBeanInfo() 278 { 279 return new MBeanInfo (getClass().getName(), null, null, null, null, null); 280 } 281 282 public Object getAttribute(String attribute) throws AttributeNotFoundException , MBeanException , ReflectionException 283 { 284 return null; 285 } 286 287 public void setAttribute(Attribute attribute) throws AttributeNotFoundException , InvalidAttributeValueException , MBeanException , ReflectionException 288 { 289 } 290 291 public AttributeList getAttributes(String [] attributes) 292 { 293 return null; 294 } 295 296 public AttributeList setAttributes(AttributeList attributes) 297 { 298 return null; 299 } 300 301 public Object invoke(String method, Object [] arguments, String [] params) throws MBeanException , ReflectionException 302 { 303 return null; 304 } 305 } 306 307 308 public static class BasicDynamic implements DynamicMBean 310 { 311 public MBeanInfo getMBeanInfo() 312 { 313 return new MBeanInfo (getClass().getName(), null, null, null, null, null); 314 } 315 316 public Object getAttribute(String attribute) throws AttributeNotFoundException , MBeanException , ReflectionException 317 { 318 return null; 319 } 320 321 public void setAttribute(Attribute attribute) throws AttributeNotFoundException , InvalidAttributeValueException , MBeanException , ReflectionException 322 { 323 } 324 325 public AttributeList getAttributes(String [] attributes) 326 { 327 return null; 328 } 329 330 public AttributeList setAttributes(AttributeList attributes) 331 { 332 return null; 333 } 334 335 public Object invoke(String method, Object [] arguments, String [] params) throws MBeanException , ReflectionException 336 { 337 return null; 338 } 339 } 340 341 342 public static class NoClassNameDynamicMBean extends BasicDynamic 344 { 345 public MBeanInfo getMBeanInfo() 346 { 347 MBeanInfo info = super.getMBeanInfo(); 348 return new MBeanInfo (null, info.getDescription(), info.getAttributes(), info.getConstructors(), info.getOperations(), info.getNotifications()); 349 } 350 } 351 352 353 public static class DynamicFromStandard extends BasicStandard implements DynamicMBean 355 { 356 public MBeanInfo getMBeanInfo() 357 { 358 return new MBeanInfo (getClass().getName(), null, null, null, null, null); 359 } 360 361 public Object getAttribute(String attribute) throws AttributeNotFoundException , MBeanException , ReflectionException 362 { 363 return null; 364 } 365 366 public void setAttribute(Attribute attribute) throws AttributeNotFoundException , InvalidAttributeValueException , MBeanException , ReflectionException 367 { 368 } 369 370 public AttributeList getAttributes(String [] attributes) 371 { 372 return new AttributeList (); 373 } 374 375 public AttributeList setAttributes(AttributeList attributes) 376 { 377 return new AttributeList (); 378 } 379 380 public Object invoke(String method, Object [] arguments, String [] params) throws MBeanException , ReflectionException 381 { 382 return null; 383 } 384 } 385 386 387 public interface StandardFromDynamicMBean 390 { 391 } 392 393 public static class StandardFromDynamic extends DynamicFromStandard implements StandardFromDynamicMBean 394 { 395 } 396 397 } 398 | Popular Tags |