1 22 package org.jboss.test.aop.bean; 23 24 29 public class TxLockedPOJO 30 { 31 32 public TxLockedPOJO() 33 { 34 field = 0; 35 } 36 37 private int field; 38 39 public int getField() { return field; } 40 public void setField(int val) 41 { 42 if (val == 6 && field == 0) 43 { 44 throw new RuntimeException ("TxLock didn't work. 2nd thread got there first."); 45 } 46 if (val == 5) 47 { 48 try { Thread.sleep(5000); } catch (Exception ignored) { } 50 } 51 field = val; 52 } 53 54 } 55 56 | Popular Tags |