1 7 package test.wsdl.session; 8 9 12 public class SessionTestSoapBindingImpl 13 implements test.wsdl.session.SessionTestServer { 14 15 22 public boolean doSomething() throws java.rmi.RemoteException { 23 24 boolean succeeded = true; 26 int count = countUp(); 27 28 if (count != 1) { 29 System.out.println("Failed with count=" + count); 30 succeeded = false; 31 } 32 try { 33 Thread.currentThread().sleep(999); 35 } catch (InterruptedException e) { 36 } 38 39 count = countDown(); 41 if (count != 0) { 42 System.out.println("Failed with count=" + count); 43 succeeded = false; 44 } 45 return succeeded; 46 } 47 48 53 private synchronized int countUp() { 54 sessionCallers++; 55 return sessionCallers; 56 } 57 58 63 private synchronized int countDown() { 64 sessionCallers--; 65 return sessionCallers; 66 } 67 68 69 private int sessionCallers = 0; 70 } 71 | Popular Tags |