User: ejort Date: 02/03/29 02:44:32 Modified: src/main/test/compliance/monitor/support Tag: BranchMX_1_0 CounterSupport.java GaugeSupport.java MonitorSupport.java StringSupport.java Log: More monitor testing Revision Changes Path No revision No revision 1.1.2.2 +2 -8 jmx/src/main/test/compliance/monitor/support/CounterSupport.java Index: CounterSupport.java =================================================================== RCS file: /cvsroot/jboss/jmx/src/main/test/compliance/monitor/support/CounterSupport.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- CounterSupport.java 24 Mar 2002 11:50:27 -0000 1.1.2.1 +++ CounterSupport.java 29 Mar 2002 10:44:32 -0000 1.1.2.2 @@ -15,15 +15,9 @@ public Number getValue() { + unlock("get"); lock("get"); - try - { - return value; - } - finally - { - unlock("get"); - } + return value; } public void setValue(Number value) 1.1.2.2 +2 -8 jmx/src/main/test/compliance/monitor/support/GaugeSupport.java Index: GaugeSupport.java =================================================================== RCS file: /cvsroot/jboss/jmx/src/main/test/compliance/monitor/support/GaugeSupport.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- GaugeSupport.java 24 Mar 2002 11:50:27 -0000 1.1.2.1 +++ GaugeSupport.java 29 Mar 2002 10:44:32 -0000 1.1.2.2 @@ -15,15 +15,9 @@ public Number getValue() { + unlock("get"); lock("get"); - try - { - return value; - } - finally - { - unlock("get"); - } + return value; } public void setValue(Number value) 1.1.2.2 +10 -4 jmx/src/main/test/compliance/monitor/support/MonitorSupport.java Index: MonitorSupport.java =================================================================== RCS file: /cvsroot/jboss/jmx/src/main/test/compliance/monitor/support/MonitorSupport.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- MonitorSupport.java 24 Mar 2002 11:50:27 -0000 1.1.2.1 +++ MonitorSupport.java 29 Mar 2002 10:44:32 -0000 1.1.2.2 @@ -11,25 +11,31 @@ public class MonitorSupport { - String last = "get"; + boolean done = false; + String last = "set"; public synchronized void lock(String who) { - if (last.equals(who)) + if (!done && last.equals(who)) { try { wait(MonitorSUITE.MAX_WAIT); } catch (InterruptedException e) {} - if (last.equals(who)) + if (!done && last.equals(who)) throw new RuntimeException("-- Time Out --"); } } public synchronized void unlock(String who) { - if (last.equals(who)) + if (!done && last.equals(who)) throw new RuntimeException("-- Synchronization failure --"); last=who; + notifyAll(); + } + public synchronized void end() + { + done = true; notifyAll(); } } 1.1.2.2 +2 -9 jmx/src/main/test/compliance/monitor/support/StringSupport.java Index: StringSupport.java =================================================================== RCS file: /cvsroot/jboss/jmx/src/main/test/compliance/monitor/support/StringSupport.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- StringSupport.java 24 Mar 2002 11:50:27 -0000 1.1.2.1 +++ StringSupport.java 29 Mar 2002 10:44:32 -0000 1.1.2.2 @@ -15,20 +15,13 @@ public String getValue() { + unlock("get"); lock("get"); - try - { - return value; - } - finally - { - unlock("get"); - } + return value; } public void setValue(String value) { - lock("set"); this.value = value; }
_______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development