1 22 package org.jboss.test.system.controller.support; 23 24 import java.math.BigDecimal ; 25 import java.math.BigInteger ; 26 import java.util.Collection ; 27 import java.util.Date ; 28 29 import javax.management.ObjectName ; 30 31 import org.jboss.system.ServiceMBeanSupport; 32 import org.jboss.test.system.controller.integration.support.SimpleBean; 33 import org.jboss.util.NotImplementedException; 34 import org.w3c.dom.Element ; 35 36 42 public class Simple extends ServiceMBeanSupport implements SimpleMBean, SimpleStandardMBeanInterface 43 { 44 public String constructorUsed; 45 46 public int createOrder; 47 public int startOrder; 48 public int stopOrder; 49 public int destroyOrder; 50 51 boolean touched = false; 52 53 54 private Object object; 55 56 57 private String aString; 58 59 60 private Byte aByte; 61 62 63 private Boolean aBoolean; 64 65 66 private Character aCharacter; 67 68 69 private Short aShort; 70 71 72 private Integer anInt; 73 74 75 private Long aLong; 76 77 78 private Float aFloat; 79 80 81 private Double aDouble; 82 83 84 private Date aDate; 85 86 87 private BigDecimal aBigDecimal; 88 89 90 private BigInteger aBigInteger; 91 92 93 private byte abyte; 94 95 96 private boolean aboolean; 97 98 99 private char achar; 100 101 102 private short ashort; 103 104 105 private int anint; 106 107 108 private long along; 109 110 111 private float afloat; 112 113 114 private double adouble; 115 116 117 private Number aNumber; 118 119 120 private ObjectName objectName; 121 122 123 private Collection <ObjectName > objectNames; 124 125 126 private String attribute1; 127 128 129 private String attribute2; 130 131 132 private ObjectName objectNameAttribute1; 133 134 135 private ObjectName objectNameAttribute2; 136 137 138 private Collection <ObjectName > objectNamesAttribute1; 139 140 141 private Collection <ObjectName > objectNamesAttribute2; 142 143 private SimpleStandardMBeanInterface proxy; 144 145 private Element element; 146 147 private JavaBean javaBean; 148 149 private Simple simple; 150 151 private SimpleBean simpleBean; 152 153 public Simple() 154 { 155 constructorUsed = "()"; 156 } 157 158 public Simple(String string) 159 { 160 constructorUsed = "(java.lang.String)"; 161 aString = string; 162 if ("error".equals(string)) 163 throw new Error (); 164 if ("exception".equals(string)) 165 throw new RuntimeException (); 166 } 167 168 public Simple(int integer) 169 { 170 constructorUsed = "(int)"; 171 anint = integer; 172 } 173 174 public Simple(int integer, float number) 175 { 176 constructorUsed = "(int,float)"; 177 anint = integer; 178 afloat = number; 179 } 180 181 public Simple getInstance() 182 { 183 return this; 184 } 185 186 protected void createService() 187 { 188 createOrder = Order.getOrder(); 189 if ("ERRORINCREATE".equals(aString)) 190 throw new Error ("BROKEN CREATE"); 191 } 192 193 protected void startService() 194 { 195 startOrder = Order.getOrder(); 196 if ("ERRORINSTART".equals(aString)) 197 throw new Error ("BROKEN START"); 198 } 199 200 protected void stopService() 201 { 202 stopOrder = Order.getOrder(); 203 if ("ERRORINSTOP".equals(aString)) 204 throw new Error ("BROKEN STOP"); 205 } 206 207 protected void destroyService() 208 { 209 destroyOrder = Order.getOrder(); 210 if ("ERRORINDESTROY".equals(aString)) 211 throw new Error ("BROKEN DESTROY"); 212 } 213 214 public Object getObject() 215 { 216 return object; 217 } 218 219 public void setObject(Object object) 220 { 221 this.object = object; 222 } 223 224 public BigDecimal getABigDecimal() 225 { 226 return aBigDecimal; 227 } 228 229 public void setABigDecimal(BigDecimal bigDecimal) 230 { 231 aBigDecimal = bigDecimal; 232 } 233 234 public BigInteger getABigInteger() 235 { 236 return aBigInteger; 237 } 238 239 public void setABigInteger(BigInteger bigInteger) 240 { 241 aBigInteger = bigInteger; 242 } 243 244 public boolean isAboolean() 245 { 246 return aboolean; 247 } 248 249 public void setAboolean(boolean aboolean) 250 { 251 this.aboolean = aboolean; 252 } 253 254 public Boolean getABoolean() 255 { 256 return aBoolean; 257 } 258 259 public void setABoolean(Boolean boolean1) 260 { 261 aBoolean = boolean1; 262 } 263 264 public Number getANumber() 265 { 266 return aNumber; 267 } 268 269 public void setANumber(Number number) 270 { 271 aNumber = number; 272 } 273 274 public byte getAbyte() 275 { 276 return abyte; 277 } 278 279 public void setAbyte(byte abyte) 280 { 281 this.abyte = abyte; 282 } 283 284 public Byte getAByte() 285 { 286 return aByte; 287 } 288 289 public void setAByte(Byte byte1) 290 { 291 aByte = byte1; 292 } 293 294 public char getAchar() 295 { 296 return achar; 297 } 298 299 public void setAchar(char achar) 300 { 301 this.achar = achar; 302 } 303 304 public Character getACharacter() 305 { 306 return aCharacter; 307 } 308 309 public void setACharacter(Character character) 310 { 311 aCharacter = character; 312 } 313 314 public Date getADate() 315 { 316 return aDate; 317 } 318 319 public void setADate(Date date) 320 { 321 aDate = date; 322 } 323 324 public double getAdouble() 325 { 326 return adouble; 327 } 328 329 public void setAdouble(double adouble) 330 { 331 this.adouble = adouble; 332 } 333 334 public Double getADouble() 335 { 336 return aDouble; 337 } 338 339 public void setADouble(Double double1) 340 { 341 aDouble = double1; 342 } 343 344 public float getAfloat() 345 { 346 return afloat; 347 } 348 349 public void setAfloat(float afloat) 350 { 351 this.afloat = afloat; 352 } 353 354 public Float getAFloat() 355 { 356 return aFloat; 357 } 358 359 public void setAFloat(Float float1) 360 { 361 aFloat = float1; 362 } 363 364 public long getAlong() 365 { 366 return along; 367 } 368 369 public void setAlong(long along) 370 { 371 this.along = along; 372 } 373 374 public Long getALong() 375 { 376 return aLong; 377 } 378 379 public void setALong(Long long1) 380 { 381 aLong = long1; 382 } 383 384 public int getAnint() 385 { 386 return anint; 387 } 388 389 public void setAnint(int anint) 390 { 391 this.anint = anint; 392 } 393 394 public Integer getAnInt() 395 { 396 return anInt; 397 } 398 399 public void setAnInt(Integer anInt) 400 { 401 this.anInt = anInt; 402 } 403 404 public short getAshort() 405 { 406 return ashort; 407 } 408 409 public void setAshort(short ashort) 410 { 411 this.ashort = ashort; 412 } 413 414 public Short getAShort() 415 { 416 return aShort; 417 } 418 419 public void setAShort(Short short1) 420 { 421 aShort = short1; 422 } 423 424 public String getAString() 425 { 426 return aString; 427 } 428 429 public void setAString(String string) 430 { 431 aString = string; 432 if ("ERRORINPROPERTY".equals(aString)) 433 throw new Error ("BROKEN PROPERTY"); 434 } 435 436 public ObjectName getObjectName() 437 { 438 return objectName; 439 } 440 441 public void setObjectName(ObjectName objectName) 442 { 443 this.objectName = objectName; 444 } 445 446 public Collection <ObjectName > getObjectNames() 447 { 448 return objectNames; 449 } 450 451 public void setObjectNames(Collection <ObjectName > objectNames) 452 { 453 this.objectNames = objectNames; 454 } 455 456 public String echoReverse(String test) 457 { 458 StringBuilder builder = new StringBuilder (test); 459 return builder.reverse().toString(); 460 } 461 462 public void touch() 463 { 464 this.touched = true; 465 } 466 467 public boolean isTouched() 468 { 469 return touched; 470 } 471 472 public void setBrokenAttribute(String broken) 473 { 474 throw new Error ("BROKEN"); 475 } 476 477 public String getAttribute1() 478 { 479 return attribute1; 480 } 481 482 public void setAttribute1(String attribute1) 483 { 484 this.attribute1 = attribute1; 485 } 486 487 public String getAttribute2() 488 { 489 return attribute2; 490 } 491 492 public void setAttribute2(String attribute2) 493 { 494 this.attribute2 = attribute2; 495 } 496 497 public void setBrokenObjectNameAttribute(ObjectName broken) 498 { 499 throw new Error ("BROKEN"); 500 } 501 502 public ObjectName getObjectNameAttribute1() 503 { 504 return objectNameAttribute1; 505 } 506 507 public void setObjectNameAttribute1(ObjectName objectNameAttribute1) 508 { 509 this.objectNameAttribute1 = objectNameAttribute1; 510 } 511 512 public ObjectName getObjectNameAttribute2() 513 { 514 return objectNameAttribute2; 515 } 516 517 public void setObjectNameAttribute2(ObjectName objectNameAttribute2) 518 { 519 this.objectNameAttribute2 = objectNameAttribute2; 520 } 521 522 public void setBrokenObjectNamesAttribute(Collection <ObjectName > broken) 523 { 524 throw new Error ("BROKEN"); 525 } 526 527 public Collection <ObjectName > getObjectNamesAttribute1() 528 { 529 return objectNamesAttribute1; 530 } 531 532 public void setObjectNamesAttribute1(Collection <ObjectName > objectNamesAttribute1) 533 { 534 this.objectNamesAttribute1 = objectNamesAttribute1; 535 } 536 537 public Collection <ObjectName > getObjectNamesAttribute2() 538 { 539 return objectNamesAttribute2; 540 } 541 542 public void setObjectNamesAttribute2(Collection <ObjectName > objectNamesAttribute2) 543 { 544 this.objectNamesAttribute2 = objectNamesAttribute2; 545 } 546 547 public String getReadOnly() 548 { 549 return "ReadOnly!"; 550 } 551 552 public void setReadOnly(String readOnly) 553 { 554 throw new NotImplementedException("THIS ATTRIBUTE SHOULD BE READ ONLY!"); 555 } 556 557 public SimpleStandardMBeanInterface getProxy() 558 { 559 return proxy; 560 } 561 562 public void setProxy(SimpleStandardMBeanInterface proxy) 563 { 564 this.proxy = proxy; 565 } 566 567 public void touchProxy() 568 { 569 proxy.touch(); 570 } 571 572 public Element getElement() 573 { 574 return element; 575 } 576 577 public void setElement(Element element) 578 { 579 this.element = element; 580 } 581 582 public JavaBean getJavaBean() 583 { 584 return javaBean; 585 } 586 587 public void setJavaBean(JavaBean javaBean) 588 { 589 this.javaBean = javaBean; 590 } 591 592 public Simple getSimple() 593 { 594 return simple; 595 } 596 597 public void setSimple(Simple simple) 598 { 599 this.simple = simple; 600 } 601 602 public SimpleBean getSimpleBean() 603 { 604 return simpleBean; 605 } 606 607 public void setSimpleBean(SimpleBean simpleBean) 608 { 609 this.simpleBean = simpleBean; 610 } 611 } 612 | Popular Tags |